Flashing correct memory address issue
I’m running STM32 Workbench v1.8.2 on OSX. And I am trying out this example firmware: http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-ode-function-pack-sw/fp-sns-allmems1.html?ecmp=tt4023_gl_enews_aug2016
I am using the Nucleo STM32L476RG shielded with the X-NUCLEO-IKSO1A1 and X-NUCLEO-IDB05A1.
According to the documentation the bootloader needs to be flashed to 0x08000000 and the firmware program needs to be flashed to 0x08004000.
Everytime I make a change to the sample code in Workbench, rebuild, and try to flash by selecting Target, it does not change the underlying program. I verified this by changing the BLE local name being advertised to something else, and when I flash the change, the name being advertised does not change at all.
I looked at the logs that come out when flashing on Workbench and I see this:
Programming Started
auto erase enabled
Info : Device id = 0x10076415
Info : STM32L4xx flash size is 1024kb, base address is 0x8000000
STM32L476.cpu: target state: halted
It says that the base address is 0x08000000, is that the issue?
Anyways, I wanted to test using STM32 ST-Link to flash the program binary to 0x08004000 and finally, the local name advertized finally reflects my change.
If Workbench is the issue, is there a way to configure it to flash at a specific address?
EDIT:
After further tries I noticed the following:
If you flash the program firmware using Workbench, it overwrites the bootloader AND it does flash to the correct location (explained later), it’s just that the program does not “restart” or “reset” (I did check the Reset after Flash checkbox) to reflect the new changes. Once I power cycle, the program no longer starts up presumably because the bootloader has been wiped out and also because it is not advertizing in BLE. So I flash the bootloader back in, and the program now runs, however, it is now the NEW program that runs, which is really interesting.