2018-05-07 04:31 AM
Hello all,
I want to use the IAP possibility off my Nucleo-STM32L073RZ. I read the AN4657 and downloaded the X-CUBE-IAP-USART folder. I thinck I have an generell problem of understanding the iap. I have a little programm for my Nucleo for using USART and the push buttons. How can I add the iap possibility to my projekt that after a reset the menu will be shown in the terminal program? Maybe you can help me to get a better understanding of this?
Regards
Tobias
Solved! Go to Solution.
2018-05-14 10:52 AM
The image you show here is for code that was clearly NOT linked for an 0x08004000 basis (see linker script, scatter file, ie .LD, .SCT, or .ICP)
The ResetHander is marked as being at 0x08000345 which is below the 0x08004000 threshold.
2018-05-07 05:37 AM
Can you use the USART in other situations?
Review the example code for the EVAL board and port to the NUCLEO by addressing any differences in pins or USART/LPUART in use. Use a merge tool to pull across code
STM32Cube_FW_L0_V1.10.0\Projects\STM32L073Z_EVAL\Applications\IAP
2018-05-08 05:33 AM
Hello Clive One,
thanks for your reply. I found the STM32L073Z_EVAL IAP-Projekt and after some fixes it runs on my Nucleo Board. I use Tera Term for the communication and to load the new pgram. The menu starts stable every time. But when I wanted to load the .bin filme there are some problems. Sometimes the load bar stops at 8% for a while and after it reaches the 100% nothing happens and the menu crashes. Sometimes the load process gets finished as well and when I press ''3'' for executing the program I only see the start program string (see attached picture) and nothing happens. After a reset in this state the old program runs on the Nucleo. Seems linke the erase function doesnt work or maybe works on the wrong addres. Can somebody help me how ich can check the adress of the flash for erase und write? Or tell me what I am doing wrong?
Regards
Tobias
2018-05-09 08:03 AM
,
,
Hello all,
I used the stm32 st-link utility tool to analyse the flash and set the , ♯ define APPLICATION_ADDRESS to , , (uint32_t)0x08004000. I put a call of the erase funktion at the beginning auf the download image funktion, so that the flash gets resetet before I upload the image.
,
void SerialDownload(void),
{,
, FLASH_If_Erase(((uint32_t)0x08004000)),Here is a screenshot of the rigster values after I send a ''1'' for download image and before I send it via ymodem.
As you can see, all registers are cleared. Then I loaded the .bin file via ymodem und analysed the registers again:
As you can see, uploading of the image works and the code beginns at 0x08004000. The .bin file consist a small projekt were I toggle the led. But it doesnt work when I press ''3'' for execute the loaded application. I looked in the menu.c and this is the code which runs by pressing 3:
, , , case '3' :
,
, , , , , Serial_PutString((uint8_t *)''Start program execution......\r\n\n''),,
, , , , , /* execute the new program */,
, , , , , JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4),,
, , , , , /* Jump to user application */,
, , , , , JumpToApplication = (pFunction) JumpAddress,,
, , , , , /* Initialize user application's Stack Pointer */,
, , , , , __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS),,
, , , , , JumpToApplication(),,
, , , , , break,Maybe someone has an idea what I am doing wrong and why the uploaded program doesnt work?
Regards
Tobias
2018-05-14 07:04 AM
Hallo all,
I tested to set the APPLICATION_ADDRESS to (uint32_t)0x08000000 so the IAP-code jumps with JumpToApplication(); to itself and this works. So I can write a new program to APPLICATION_ADDRESS (see post above) and the Jump function works. There musst be a little mistake left. I gues there is something wrong when I set the jumpaddress, here is the code for that:
JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
JumpToApplication = (pFunction) JumpAddress; /* Initialize user application's Stack Pointer */ __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);when I analyse this in debug session, I can see that the value of the jump address:
but when I have a look at this value I can see that 0x08000D7D doesnt exist as a address:
Isnt there someone who can give me a little tip or something where I have to look to find the mistake?
Regards
Tobias
2018-05-14 10:52 AM
The image you show here is for code that was clearly NOT linked for an 0x08004000 basis (see linker script, scatter file, ie .LD, .SCT, or .ICP)
The ResetHander is marked as being at 0x08000345 which is below the 0x08004000 threshold.
2018-05-15 01:30 AM
Hello Clive One,
you are right. I had to change the __ICFEDIT_intvec_start__ = 0x08004000; in the .icf and now everything works. Thank you really much for your support.
Regards
Tobias