cancel
Showing results for 
Search instead for 
Did you mean: 

Modify the start address 0x800 0000

eancelin
Associate II
Posted on June 26, 2012 at 16:26

Hi,

My microcontroller is a STM32F103CB.

I followed the AN2557 to do an IAP in my software. Everything works fine but now I would like to do something like a dual bank features.

I can flash two firmwares at two different address in flash (for example, one @0x8003000 and the second @0x8006000) but when my IAP software starts (@0x800 0000), if I do the classical test ( if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000) ) the first bank will be still OK, so I never start the firmware in the second flash.

Is there a way to set an option to know which ''bank'' is activated?

Is there a way to modify by software the start address (modify the 0x800 0000 address)?

I hope my request is enought clear!!

Regards,

#flash #groundhog-day #start-address #iap #stm32
28 REPLIES 28
duongcam1312
Associate II
Posted on July 19, 2012 at 03:35

Thanks for your answer. And I have problem want you explained to me 

code :    JumpAddress = *(__IO uint32_t*) (

ApplicationAddress + 4

);

             Jump_To_Application = (pFunction) JumpAddress;

                 /* Initialize user application's Stack Pointer */

             __set_MSP(*(__IO uint32_t*) ApplicationAddress);

             Jump_To_Application();

Why need ''

+4

'' ?    

Thank you verry much.
Posted on July 19, 2012 at 13:09

Why need ''

+4

'' ? Review the vector table content. +0 Initial Stack Pointer +4 Initial Program Counter

g_pfnVectors:
.word _estack
.word Reset_Handler
.word NMI_Handler
.word HardFault_Handler
.word MemManage_Handler
.word BusFault_Handler
.word UsageFault_Handler

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
duongcam1312
Associate II
Posted on August 20, 2012 at 04:35

Hi clive1 ! 

How to detection program hang? I want watchdog or reset system,if program hang.but i don't known Flag or regedit to detection them

Thank you verry much

.

Posted on August 20, 2012 at 18:22

Depends on how/where it locks-up.

If you have an RTOS, you could kick the watchdog it the lowest priority task, if that never gets executed in these conditions.

Is code getting stuck in a Hard Fault handler?

Do you have code with unbounded while() loops? Could you add timeouts to these and handle the error propagation better?

Do you get stuck in interrupt context?

Other methods use two layers, a software layer that has multiple check points, say each task masking a completion bit, once all tasks indicate completion the hardware watchdog is kicked.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
duongcam1312
Associate II
Posted on August 21, 2012 at 03:31

Thank for your help !

I don't have RTOS. I working IAP, and I want progrram Bootloader check to detection program application hang or don't working.

Arnhold.Rodrigo
Associate
Posted on February 09, 2015 at 17:29

Hello haui.bien! Recently I came across a similar problem what you reported on the forum. I'm using a STM32F103RB with bootloader + application. I configured NVIC_VectTab_FLASH , 0x08000000 to the bootloader and NVIC_VectTab_FLASH , 0x08003000 for the application. But it only works if the application is set to NVIC_VectTab_FLASH , 0x08000000 . I use keil 5 environment. In ''options for target/Target/Read/Only Memory Areas'' the start address '' IROM1 '' is set to 0x8003000 and size 0x1D000 . What am I doing wrong?

I am new in this MCU. Thanks

Posted on February 09, 2015 at 17:55

What am I doing wrong?

 

Real hard to determine from the data. You'd need to confirm the firmware is built for the correct location by reviewing the .MAP file. You'd also want to confirm the address programmed into the SCB->VTOR register during SystemInit() does actually point to your application code.

You also need to confirm your boot code is built correctly, and that it transfers control properly to the application, and doesn't have any interrupts enabled which might break if unhandled by an uninitialized application.

Use a debugger.

Step through your transition code, review where the current code breaks or hangs up. Check that core registers a set up at the addresses you expect them to be.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Arnhold.Rodrigo
Associate
Posted on February 11, 2015 at 01:31

Hi Clive1 . The code which I am working was done by someone else with I no more have contact. I worked with other codes that were built with 0x08000000 starting address as in this code. When added the bootloader to these other codes , the only changes I made was to change the starting address 0x08003000 in keil ''target options/target/ROM1'' and change NVIC_SetVectorTable ( NVIC_VectTab_FLASH , 0x3000 ) ; However this code when I change these parameters does not work. When I debug the code these errors occur .

Can not access Memory

*** Error 122: AGDI : memory read failed ( 0xFFFFFFFE )

Can not access Memory

Can not access Memory

Can not access Memory

Can not access Memory

Can not access Memory

I'm not relating the problem to the bootloader , because I'm trying to work only writing the application in flash with initial address 0x0800300 , as well as in other code that I worked , which work with both start addresses .

hpb
Associate II
Posted on April 08, 2015 at 14:18

Hi there,

did somebody find the reason?

I've the same problem. An application, which works fine at start-address 0x0800 0000 doesn't work at 0x0802 0000. Some code works at this start-address, also interrupts etc. are working fine. But if the LCD is integrated to the code, the software stops working - don't know why.

At address 0x0800 0000 I have (at the moment) only a redirection to the vector-table at 0x0802 0000 and jump it (+4+1).

... it's really crazy and would be fine, if somebody would have an idea ...

Best regards,

Hans-Peter

---

By the way: It's necessary to jump to (APPLICATION_ADDRESS +4 +1).

hpb
Associate II
Posted on April 08, 2015 at 14:28

I've find something out at my board (STM32F429i-DISCOVERY). If the display it operated in LTDC-Mode, it fails.

My problem: LTDC-Mode is used at my custom-bootloader.

Has somebody an idea how to reset the STM32F429 by reset - but to avoid that it will jump back to bootloader?

... thank's ...