2017-10-20 03:19 AM
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-flash2017-10-20 06:34 AM
Hello Stefano ,
You can find some useful informations in the document (cf attachment) from the Flash Component.
Best regards
Erwan
2017-10-23 10:29 AM
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,
Stefano2017-10-24 02:36 AM
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
2017-10-25 05:38 AM
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