cancel
Showing results for 
Search instead for 
Did you mean: 

upsd33xx bootloader code

hpaskal
Associate II
Posted on June 20, 2004 at 04:23

upsd33xx bootloader code

4 REPLIES 4
hpaskal
Associate II
Posted on May 17, 2011 at 12:01

Hi !

I need to implement bootloader for my upsd device.

My main program details :

*Main flash is mapped to code space 0x0000-0xFFFF (dont use paging)

*8K Sram is mapped to data space.

*secondary flash is for boot.

I need to get the code data from the uart rs232 protocol and burn it in the main flash.

1)what address space do i need to give to the secondary flash ?

2)how do i deal the interrupts in both codes ?

3)is the interrupts of the main program and the boot program should be common for both codes ?

4)how do i jump to the main flash when i finish writes to the flash ?

5)i need to run first from the boot flash , read some version of the main program from the main flash and decide if i want to bern a new firmware. how can i implement this?

6)wehre can i find an example code of 33xx loader or application note ?

Thanks

joseph2399
Associate II
Posted on May 17, 2011 at 12:01

Check out the IAP (In Application Programming) example for the 33xx.

It can be found at:

http://www.stmcu.com/modules.php?name=mcu&file=familiesdocs&fam=80

The example is found under the header ''Software for Tools'' in the zip file with the description: uPSD3300 Demo Software for DK3300 Development Kit.
hpaskal
Associate II
Posted on May 17, 2011 at 12:01

1)My loader project sets the SRAM to XDATA address: X:0x2000 - X:0x3FFF

and variables like uart rx and tx buffers are declared there .

So in the Loader project ,when i set the Main Flash resides in data space, i will have a conflict

because the Main flash is in address 0x0000 - 0xFFFF( in code space in the main application)

and in the Loader project its in the data space.

so how do i manage this conflict ?

because i will want to erase all main flash (0x0000 - 0xFFFF) before i will burn it with code .

and i will also will want to put code there in main flash address 0x2000 - 0x3FFF.

Am i right ?

2)In uPSD33XX datasheet on page 77 it says that the flash memory should be erased

prior to being programmed.

So , should i call to flash_erase_sector() function first ?

I am asking this because in your example i didn't see a call to this function

before writing the flash .

3)if The boot loader code should reside in CSBOOT0 sector.

The address space should be set to 0x0000-0x1FFF.

isn't it a conflict with my main flash that resides 0x0000 - 0xFFFF ?

haim

hanan54
Associate II
Posted on May 17, 2011 at 12:01

hi haim

1. You can''t use all the address space for the main FLASH.

you must leave space for RAM and hardware address.

2. you change from boot program to main program by changing VM register.

After changing, the program must jump to address 0 and start the program.

3. address space for the boot program 0-1fffH

see also

http://mcu.st.com/forums-cat-1489-11.html

http://mcu.st.com/forums-cat-1239-11.html

hanan

[ This message was edited by: hanan54 on 20-06-2004 08:40 ]

[ This message was edited by: hanan54 on 20-06-2004 09:32 ]

[ This message was edited by: hanan54 on 20-06-2004 09:33 ]