Greetings,
I have searched the forums and found similar posts but none of them addressed my issue so I'm posting yet another one here.
Using Tiva C TM4C1294NCPDT on Launchpad TM4C1294XL, am unable to repeatedly program BOOTCFG register or trigger a boot using a pin. I managed to program the bootcfg once, but am not sure how because I cannot reprogram it.
Goal is to drive GPIO PB4 low as boot trigger, reset and then bootload on the Uart 0 port.
* Using default key 0xA442 per the data sheet for BOOTCFG.
* Want to bootload using PB4 grounded when reset occurs.
* Setting all reserved bits high in register writes.
* BOOTCFG currently reported by ccs to be 0x7FFF30FE but can't be changed!
Using code composer studio and can therefore view the contents of the flash registers while stepping thru the code.
* Per data sheet, FLASHCTRL_BASE = 0x400FD000
FMA_OFFSET = 0x000
FMD_OFFSET = 0x004
FMC_OFFSET = 0x008
BOOTCFG_OFFSET = 0x01D0
=================================================================
SEQUENCE - please verify this is correct for writing to BOOTCFG
=================================================================
// ===================================================
// 1. Write BOOTCFG offset to FMA register 0x400FD000
// FMA: D31-D20 RESERVED, D19-D0 OFFSET
// ===================================================
*((volatile uint32_t *)(0x400FD000)) = (uint32_t)0xFFF001D0; // this
// =================================================
// 2 . Write bootcfg data to FMD register 0x400FD004.
// D31-D0 DATA
// =================================================
//*((volatile uint32_t *)(0x400FD004)) = (uint32_t)0x7FFF30FE;
*((volatile uint32_t *)(0x400FD004)) = (uint32_t)0x7FFFFFFE;
//=======================================================================
// 3. Write FMC register 0x400FD008
// D31-D16 WRKEY, D15-D4 reserved, D3 COMT, D2 MERASE, D1 ERASE, D0 WRITE
//=======================================================================
*((volatile uint32_t *)(0x400FD008)) = (uint32_t)0xA442FFF0; // tried setting write and commit here also
*((volatile uint32_t *)(0x400FD008)) |= (uint32_t)0x1; // set WRITE
*((volatile uint32_t *)(0x400FD008)) |= (uint32_t)0x8; // set COMMIT
========
details
========
Using CCS, registers FMA and FMD can be seen to change when written to.
FMC never changes and stays all zeros in the ccs register window.
when FMC is written to, register FLASH_FCRIS is seen to change to a value of 3
Currently BOOTCFG is set to 0x7FFF30FE which means a low on PB4 during reset
should force the ROM bootloader to execute. It does not do so but my code which
flashes LEDs does not run either. Seems to go into the weeds. The bootloader
download command sent from a windows side program to Tiva Uart 0 receives no reply.
If I call the ROM bootload function in my code on the target, the windows side download command
works fine (using Uart 0 on Tiva) and reflash works.
When I attempt the pin triggered bootload, I ground PB4 then power up the launchpad
then push launchpad reset button then start the windows application.
What am I doing incorrectly?
Thanks
Randall Miner (randall_miner@jabil.com)