hi!
Currently on renesas synergy s7g2-sk board
I am checking the operation to the external memory with the QSPI sample "simple_QSPI_Example".
There is an unknown point in the operation of the sample, and the problem is
Writing is done at an unspecified address
I'm in trouble because I don't know the operation of the above one point.
For the problem, sample numbers are recorded at memory addresses 0x60000000, 0x61000000, 0x62000000, 0x63000000.
The BSP is from s7g2-sk and has not been changed.
The script is set according to the memory size.
The sample code is written in hal_entry.c
A sample code is shown below.
Could you please give me any advice?
Thank you.
Hello Kawamura,
Looks like SSP 1.x.x doesn't support the 4 bytes addressing naturally. I've just checked this option in my SSP 2.2.0, and it is present these.
So if it is your new project I'd recommend…
I believe you forgot to add the sample code to your post. Can you please do this?
Kind regards,
Sergey
If this response, or one provided by another user, answers your question, please verify the answer. Thank you!
Renesas Engineering Community Moderatorhttps://community.renesas.com/https://academy.renesas.com/https://en-support.renesas.com/knowledgeBase/
hello sergey,
thank you for your reply.I forgot to post the sample code.
This sample code is taken from the Renesas sample.
If you write this sample code, the memory will be written to 0x60000000, 0x61000000, 0x62000000, 0x63000000 in hexadecimal and it will be in a mirror state.
Any advice would be great if you could let me know.
kind regard,kawamura.
//////////////////////////////////////////////////////////////////////////
#define QSPI_DEVICE_BASE_ADDR (0x60000000)void qspi_dump_mem();
void qspi_dump_mem(){volatile int i;int *qspi_mem_ptr = (int *)QSPI_DEVICE_BASE_ADDR;
i = QSPI_pad; // This line is required to force the linker to place QSPI_data[] into the second 64k sector.
for(i = 0; i < 5; i++){#ifdef USE_SEMIHOSTINGif (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk){int qspi_data = (int)&QSPI_data[i];printf("0x%x: 0x%08x 0x%x: 0x%08x \n", (int)qspi_mem_ptr,*qspi_mem_ptr,qspi_data,QSPI_data[i]);}#endifqspi_mem_ptr++;}}
/*******************************************************************************************************************//*** @brief Blinky example application** Blinks all leds at a rate of 1 second using the software delay function provided by the BSP.* Only references two other modules including the BSP, IOPORT.***********************************************************************************************************************/void hal_entry(void) {
#ifdef USE_SEMIHOSTINGif (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk){#if defined(__GNUC__) /* GCC Compiler */initialise_monitor_handles();#endifprintf("Simple QSPI example\n");
printf("QSPI memory after Jlink programming\n");#endif}
qspi_dump_mem();
#if 1{bool write_in_progress;int retval;
retval = g_qspi0.p_api->open(g_qspi0.p_ctrl, g_qspi0.p_cfg);if (!retval){retval = g_qspi0.p_api->sectorErase(g_qspi0.p_ctrl, (uint8_t *)QSPI_data);}if (!retval){/* Wait for the erase to complete */write_in_progress = 1;while (write_in_progress & 1){retval = g_qspi0.p_api->statusGet(g_qspi0.p_ctrl, &write_in_progress);}}retval = g_qspi0.p_api->close(g_qspi0.p_ctrl);}#endif
#ifdef USE_SEMIHOSTINGif (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk){printf("QSPI memory after sector erase\n");}#endif
#if 1{bool write_in_progress;int retval;int new_data[] = {0x00009999, 0x00008888, 0x00007777, 0x00006666, 0x00005555};
retval = g_qspi0.p_api->open(g_qspi0.p_ctrl, g_qspi0.p_cfg);if (!retval){retval = g_qspi0.p_api->pageProgram(g_qspi0.p_ctrl, (uint8_t *)QSPI_data, (uint8_t *)new_data, sizeof(new_data));}if (!retval){/* Wait for the erase to complete */write_in_progress = 1;while (write_in_progress & 1){retval = g_qspi0.p_api->statusGet(g_qspi0.p_ctrl, &write_in_progress);}}retval = g_qspi0.p_api->close(g_qspi0.p_ctrl);}#endif
#ifdef USE_SEMIHOSTINGif (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk){printf("QSPI memory after page program\n");}#endif
#ifdef USE_SEMIHOSTINGif (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk){printf("Calling Blinky\n");}#endifblinky();
while(1){};}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Looks like in this post the same issue is described, and it is solved by entering the 4-bytes addressing mode: https://community.renesas.com/mcu-mpu/embedded-system-platform/f/forum/14174/s7g2-qspi-nor-flash-mirroring-issue
thank you for your reply.
thank you for the advice!I know that setting it to 4byte mode solves the problem.What part would you like to change specifically?I looked at the URL you gave me, but I didn't know where I changed it.
please,can you tell me.
kawamura.
You need to change it in the SSP configurator like it's shown here: community.renesas.com/.../57729
Hello Sergey.
thank you for your reply, and thank you for the advice!
I checked the URL you gave me.
However, there is no setting item in SSP as written.I will share the e2 studio screen that I am looking at.
Can you give me any kind of advice?
ssp version will be 1.6.0.
So if it is your new project I'd recommend you to migrate to newer version of the SSP (the latest available one is 2.4.0 at the moment and can be downloaded from here https://www.renesas.com/us/en/products/microcontrollers-microprocessors/renesas-synergy-platform-mcus/renesas-synergy-software-package#overview).
Otherwise you need to do some tricks with the addressing, for example like the ones described here: https://community.renesas.com/mcu-mpu/embedded-system-platform/f/forum/14619/filex-on-sk-s7g2-multiple-partitions-qspi