This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I program and configure an LM4F232 into flash to start at powerup?

Other Parts Discussed in Thread: UNIFLASH

We have our own board with a LM4F232H5QD.  I am able to run an application using a XDS100V2 and can program our board with this and Uniflash.  I can verify the code on the devices flash and when I program the device, the code runs successfully.  However, he code does not start again when I power-cycle the board.  I am guessing that the BOOTCFG registers need to be correctly programmed for my code to be loaded from flash and run at startup.  I am using the following code to program the BOOTCFG registers:

regVal = HWREG(0x400FE000 + 0x1D0);
HWREG(FLASH_CTRL_BASE + 0x00) = 0x75100000;
HWREG(FLASH_CTRL_BASE + 0x04) = 0x0000A202;          / /  I am using PF0 pulled high to try to get the device to boot my code from flash on power -up
HWREG(FLASH_CTRL_BASE + 0x08) = 0xA4420008;

Am I doing this correctly, or am I missing something really obvious?

  • Hi,

    PF0 is under commit control and must be unlocked to be used as GPIO. Se the user manual.

    Petrei.

  • The code you have here looks correct to me (though I'm not sure if you need to set the WRITE bit in FMC as well as the COMMIT bit - I'm checking on this). If you want your code to execute when PF0 is high, though, it looks to me as if you have the wrong polarity set in your BOOTCFG value. If bit 9 is set, as it is here, this tells the device to branch into the ROM boot loader if the pin is high when the device resets. This will PREVENT your application from running if PF0 is high. If you want the application to run with PF0 high and the boot loader to enter if PF0 is low, try clearing bit 9.

    EDIT: Your current code is correct as far as the FMC register is concerned. You only need to set the COMMIT bit and not bot h WRITE and COMMIT.