Skip to main content
otcagon
Associate II
January 16, 2024
Solved

SPC58EC with Flash driver

  • January 16, 2024
  • 3 replies
  • 1994 views
Hello, I am currently struggline with flash program with some tools.
The tool send 62byte data with CAN FD and I want to write down it.
I am using SPC5Studio with Flash_driver (ssd_c55.h)
* FILE NAME : ssd_c55.h *
* DATE : December 19, 2011 *
* AUTHOR : FPT Team
and the function exported.
extern UINT32 FlashProgram ( PSSD_CONFIG pSSDConfig,
     BOOL factoryPgmFlag,
     UINT32 dest,
     UINT32 size,
    UINT32 source,
    PCONTEXT_DATA pCtxData
);
I modify  the eeprom_lld.c as bleow for programming the software. I checked that the len=8U works. (8U is defined in examples.)

If the len is set to 6, it is not work. in case of 4 then it is partly works. (4byte date programmed and 4bytes are skipped). Are there any way to write down the data with variable length?

uint32_t eeprom_lld_flashprogram(uint32_t address, uint64_t buffer, uint32_t len) {
   uint32_t returnvalue;
   uint32_t bufferpointer;
   uint32_t result;
   CONTEXT_DATA pgmCtxData;
   bufferpointer = (uint32_t)(&buffer);
   returnvalue = FlashProgram(&ssdConfig, FALSE, address, len, bufferpointer, &pgmCtxData);
   if (C55_OK == returnvalue) {
   /* Call FlashCheckStatus() to check status of the progress */
   while (C55_INPROGRESS == FlashCheckStatus(&ssdConfig, C55_MODE_OP_PROGRAM, &result, &pgmCtxData)) {
  }
   if (C55_OK != result) {
   return FLASH_ERROR_PROGRAM;
   }
}
else {
return FLASH_ERROR_PROGRAM;
}
(void)buffer;
return FLASH_OK;
}
Daniel Yang
Thansk
This topic has been closed for replies.
Best answer by Erwan YVIN

Hello ,

cf UM2636.pdf

In FlashProgram ,

size Size, in bytes, of the Flash region to be
programmed.
If size = 0, C55_OK returns.
It should be multiple of word and its combination with dest should
fall in either main array or UTest block.

multiple by 8, i think

    Best regards

               Erwan

3 replies

Erwan YVIN
Erwan YVINBest answer
ST Technical Moderator
January 18, 2024

Hello ,

cf UM2636.pdf

In FlashProgram ,

size Size, in bytes, of the Flash region to be
programmed.
If size = 0, C55_OK returns.
It should be multiple of word and its combination with dest should
fall in either main array or UTest block.

multiple by 8, i think

    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.
otcagon
otcagonAuthor
Associate II
January 18, 2024

Hello Erwan

 

Thanks for the reply, I tested with several value and it works with multiple of 8.

It does not work with multiple of 4.

Are there any source code avalable for the flash driver.

When I check the item from internet, I find following two document

it do not shows the full code.

https://community.nxp.com/docs/DOC-105380

https://community.nxp.com/docs/DOC-106580

 

I am not sure are there any code with C file or  not. 

Thanks.

 

Best regards

Joonseok YANG

Erwan YVIN
ST Technical Moderator
January 19, 2024

Sorry Joonseok ,

we have only the library in SPC5Studio Tools Suite.

SPC56/57/58 shoudl have the same flash driver as MPC56/57

                     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.