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.

TM4C1290NCPDT: sflash.exe works but run command does not

Part Number: TM4C1290NCPDT

Hi all

Following the documentation and code from TI I was able to implement a boot loader on my custom board with a TM4C1290NCPDT loaded at 0x0 in FLASH and my application at 0x4000. I am able to reload my application with this boot loader successfully using the sflash.exe code that I compiled from the Tivaware tools directory. It all works great, thanks!

However, I am unable to re-start the microcontroller after loading it with a boot loader, and I seem to need a full power cycle to get it to go again (at which point it works fine.)

I am sending sflash the run command with the address 0x4000 (the address of the start of my application in flash.) is that the right address I should be passing in? I thought so but now I wonder if it should instead be the resetISR vector? I am confused. I have also tried 0x0 (which is where the boot loader is in flash) and that doesn’t work either. 

Power cycling my board is not a big deal but it is a bit painful as there are other parts like FPGAs that then take time to reconfigure.

Thanks

Peter

sflash command:

./sflash ../cm_mcu.bin -r 0x4000 -p 0x4000 -c /dev/ttyUSB2 -b 115200 -d -s 76

[Though I think it’s not needed to answer this problem, I’m using the latest version of Tivaware on a Linux box based on RHEL7 with a gcc based Makefile compilation path.]

  • Hi Peter,

      After the application is loaded to the flash by the bootloader, can you do a reset instead of the power cycle? The reason that the power cycle worked was because the processor starts from the reset vector again. The bootloader will check if the application is already present at 0x4000. If the application is present, the bootloader will simply jump to 0x4000 to start the application. You can manually do a reset via the reset pin or you can try to modify the bootloader such that after the application is updated, you force a software reset by calling the SysCtlReset().  

  • Hi Charlies

    Thanks for your response. Indeed just issuing a reset works. So that is a good workaround. However, is there a reason why my ‘run’ command is not working? Should I be issuing a different address than either 0x0 or 0x4000?

    thanks

    Peter

  • Hi Peter,

      Did you set the -r ADDR to 0x4000? You should set it to 0x4000 so the processor will jump to it after the firmware is downloaded.

  • 
    

    Hi Charles

    Yes I use the following command. I tried setting it to both 0x4000 and 0x0 and neither works. Strangely 

    ./sflash ../cm_mcu.bin -r 0x4000 -p 0x4000 -c /dev/ttyUSB2 -b 115200 -d -s 76

    Strangely my version of the command has the default that no run command will be sent, not that the processor will be reset like the one you list above. I am using Tivaware 2.1.4.178.

    I suppose I’ll just add a SysCtlReset() call like you propose. Thanks for your time.

    Peter