I'm not having any joy with the boot loader on the LM3S9D92 evaluation kit. It's not responding to any commands sent to it.
I'm trying to use it on uart0 on PA0 and PA1. (I've cut the tracks that go to the 10 way header on the dev board, so that's not a problem.) I know that I've got a connection to my loading processor because I've written a couple of programs that prove that the two devices are talking to each other over this port. I'm using a baud rate of 115200, although I've tried 9600 as well.
I've tried to go into the ROM boot loader three different ways. The first was by configuring the BOOTCFG register, which proved somewhat difficult but I managed to get it to work. Also did a mass erase of the FLASH and assumed this would put it in boot loader mode on reset. Thirdly I tried the following code which I found through Google:
(*((void (*)(void))(*(unsigned long *)0x2c)))();
I've assumed that one of the above methods would work to start the ROM boot loader.
I've tried to 'ping' from my loading device by sending 0x20 at some regular interval. Nothing. Don't see anything on the oscilloscope either. Thought maybe it needed a full packet with checksum and size so I sent a 0x03,0x20,0x20 string with no result. Have also tried a 0x23 'get status' command with no reply.
Thanks
Dan
How do you actually do a callback to the ROM bootloader? I can see that (*((void (*)(void))(*(unsigned long *)0x2c)))(); will only go to the svcall vector that in all the example code only goes to a default function that while loops.
Okay, I've got it working. Thought that because it was autobauding that I should send a few regularly spaced bits with some 0x55 packets first. That seemed to do the trick.
Would still like to know how to do a callback to the ROM boot loader.
Hello Dan,
The ROM bootloaders are called using the following functions (Included in Stellarisware/driverlib/rom.h):
- ROM_UpdateSSI
- ROM_UpdateI2C
- ROM_UpdateEthernet
- ROM_UpdateUSB
- ROM_UpdateUART
The peripheral chosen for the bootlader must be fully initialized when the function gets called.
I'll discuss an example of the Ethernet ROM bootloader below.
The Ethernet ROM bootloader is called using the ROM_UpdateEthernet(), once the Ethernet peripheral has been fully initialized ( MAC + PHY).
The boot_demo_eth code example provides the necessary steps to initialize the Ethernet peripheral. See the modified boot_demo_eth.c attached.
0652.boot_demo_eth.c
Steps required to a Ethernet ROM bootloader:
- Initialize clock to 50 MHz ( Note: The clock frequency can be changed to suit your application)
- PinoutSet() : Set the device pinout for the appropriate board
- SetupForEthernet()
- Configure SysTick for 100 Hz Interrupt
- Configure the Ethernet LEDs
- Get the MAC address and store it in putMACAddr[]
- Initialize the lwIP TCP/IP Stack
- Set up UDP PCB to allow the Ethernet to acknowledge the magic packet LMFlash sends at the beginning of an bootload update
- Enable Interrupts
- Wait until LMFlash sends the magic packet, making g_bFirmwareUpdate value to true
- Disable Interrupts
- Execute ROM_UpdateEthernet(ROM_SysCtlClockGet())
The boot_demo_eth assumes there a bootloader in the memory location 0x0000-0x1800, thus the main application is programmed starting in address 0x1800. There are two options to successfully update the bootloader:
1. (Recommended) In the case the board will only be updated using the ROM bootloader, having a flash bootloader at location 0x0000 is not necessary. The linker file for the IDE you are using must be changed to define FLASH memory to start at 0x00000000, instead of 0x00001800, and finish in memory location 0x0003ffff (length = 0x40000). There are several IDEs supported by Stellaris, and each one has a different linker file:
- CCS: *.cmd
- IAR: *.icf
- Keil: *.sct
2. Download a bootloader with LMFlash Programmer (i.e. boot_serial code example), then program the boot_demo_eth in memory location 0x1800. When the board boots up it initially goes to memory location 0x0000, the Serial flash bootloader in Stellarisware initially jumps to 0x00001800 and check if the memory value is 0xFFFF. If it is 0xFFFF, it goes back to the Serial boot loader and initializes the Serial peripheral and waits for an update. In this case the memory value is not 0xFFFF, thus the main application will execute and callback the ROM Ethernet bootloader.
All the ROM bootloaders (included in Stellarisware/driverlib/rom.h) update the board starting in memory location 0x00000000. The Ethernet flash bootloader always updates the application starting in 0x00001800(specified in the boot_eth application) . The other four flash bootloaders (UART, I2C, SSI, and USB) allow the user to choose the memory location to download the main application during the application update.
Let me know if you have further questions.
- Erick
---------------------------------------------------------------------------------------------------------Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
Hello Erick,
Im using SSI to update the application. In this process, i called the bootloader using ROM_UpdateSSI. After this i could not communicate to the bootloader. Im sending COMMAND_PING command - but bootlader is not responding. Do we need to modify command before sending to it, append with number of commands ? How should i prepare a packet to communicate with the bootloader ?
Thanks - Chakra