cancel
Showing results for 
Search instead for 
Did you mean: 

Flash drivers for SPC56 L line

stefano maccari_2
Associate II
Posted on October 20, 2017 at 12:19

Flash library for SPC56xL

Hi,

I need to develop my own bootloader for SPC56EL60 microcontroller, I downloaded the flash library from SPC5 Studio, but in the Flash .c source  files I see only const unsigned char values like these (from FlashInit.c):

const unsigned char FlashInit_C[] =

{

      0x18, 0x21, 0x06, 0xE0, 0x00, 0x80, 0x1B, 0x41, 0x09, 0x08, 0xD9, 0x01, 0x01, 0x3F, 0x73, 0x40, 0xE0, 0x30, 0xC0, 0xDF

 ....

    

}; /* Total Size = 234 bytes */

Maybe I'm missing something, but I don't know how to use the files or they are the wrong files.

Thank you in advance!

kind regards,

Stefano

#spc56xl-flash #spc56-flash
4 REPLIES 4
Erwan YVIN
ST Employee
Posted on October 20, 2017 at 15:34

Hello Stefano ,

You can find some useful informations in the document (cf attachment) from the Flash Component.

0690X00000608eFQAQ.png

          Best regards

                      Erwan

Posted on October 23, 2017 at 17:29

Hi Erwan,

Thank you for the answer, I read the documentation and created an example application from SPC5 Studio wizard with FLASH drive

to understand how these API functions are called.

I still have a doubt: do I need to allocate them in ramcode  ?  Because in the example application I didn't see any reference to ramcode.

Thank you in advance !

Best Regards,

Stefano
Posted on October 24, 2017 at 09:36

Hello Stefano ,

yes, in some cases , you should launch from RAM if you manipulate the CFLASH

Anyway, there is some example how to create some functions in RAM for freegcc and hightec.

SPC560Dxx OS-Less STANDBY SRAM Test Application for Discovery cf user.ld

Create a user.ld which contains .codeinram section

 .data : AT(__romdata_start__)
 {
 . = ALIGN(4);
 __data_start__ = .;
 *(.data)
 *(.data.*)
 *(.codeinram)
 *(.gnu.linkonce.d.*)
 __sdata_start__ = . + 0x8000;
 *(.sdata)
 *(.sdata.*)
 *(.gnu.linkonce.s.*)
 __data_end__ = .;
 } > ram
�?�?�?�?�?�?�?�?�?�?�?�?�?�?

and add an attribute

__attribute__ ((section ('.codeinram'))) void gotoStandbyMode(void) {
�?

Best regards

Erwan

Posted on October 25, 2017 at 12:38

Hi Erwan

Thank you for the explanation, I created the example project and understood how to use RAM allocation, now I inserted it in my project too, and seems to work correctly.

Best Regards,

Stefano