Skip to main content
stefano maccari_2
Associate
October 20, 2017
Question

Flash drivers for SPC56 L line

  • October 20, 2017
  • 4 replies
  • 1359 views
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
    This topic has been closed for replies.

    4 replies

    Erwan YVIN
    ST Technical Moderator
    October 20, 2017
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
    stefano maccari_2
    Associate
    October 23, 2017
    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
    Erwan YVIN
    ST Technical Moderator
    October 24, 2017
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.