2024-01-05 12:32 AM
Hello,
I have a problem when i try to load a bin file using External flash.
I created my own external flash with w25q128vj and nucleo F746ZG .When i try to load a bin file with stm32programmer its work only if the bin file is smaller than 128kb.
Someone have any idea about this problem :
16:51:58 : Start operation achieved successfully
16:55:04 : Memory Programming ...
16:55:04 : Opening and parsing file: Test.bin
16:55:04 : File : Test.bin
16:55:04 : Size : 15.60 MB
16:55:04 : Address : 0x90000000
16:55:04 : Erasing memory corresponding to segment 0:
16:55:04 : Erasing external memory sectors [0 3992]
16:55:57 : Download in Progress:
16:56:31 : Error: failed to download Segment[0]
16:56:31 : Error: failed to download the File
16:56:31 : RUNNING Program ...
16:56:31 : Address: : 0x90000000
16:56:31 : Application is running, Please Hold on...
16:56:31 : Start operation achieved successfully
this is what i can see in stm32programmer.
Best Regards,
STlinkos
Solved! Go to Solution.
2024-01-06 03:05 PM
Try this, should be a 2-pin variant https://github.com/cturvey/stm32extldr/blob/main/f7_w25q128/CLIVEONE-W25Q128_STM32F7XX-PB2-PB6-PD11-PD12.stldr
If this doesn't work I'll need to break out a fixture and do some more testing
2024-01-05 06:25 AM
Hello @Stlinkos ,
Could you please check the memory parameters in Dev_Inf.c file like: Device size and Programming Page Size.
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-01-05 06:34 AM
Hello @KDJEM.1,
Thank you for you reply.
this is my dev_inf.c:
**********************************************************************************************************************************
*********************************************
* Creating an new External loader you have to
* configure the first and the third field in
* below struct. Setup also Loader_Src.c
*********************************************/
#include "main.h"
#include "Dev_Inf.h"
#include "z_flash_W25QXXX.h"
/* This structure containes information used by ST-LINK Utility to program and erase the device */
#if defined (__ICCARM__)
__root struct StorageInfo const StorageInfo = {
#else
struct StorageInfo const StorageInfo = {
#endif
"W25Q128_NUCLEO-746ZG_LED", // Device Name + version number
SPI_FLASH, // Device Type (that's from Dev_Inf.h)
0x90000000, // Device Start Address
EXT_FLASH_SIZE, // Device Size in Bytes (that's from Flash interface package)
EXT_FLASH_PAGE_SIZE, // Programming Page Size (that's from Flash interface package)
0xFF, // Initial Content of Erased Memory
// Specify Size and Address of Sectors (view example below)
EXT_FLASH_PAGE_NUM, EXT_FLASH_SECTOR_SIZE, // (that's from Flash interface package)
0x00000000, 0x00000000,
};
/* Sector coding example
A device with succives 16 Sectors of 1KBytes, 128 Sectors of 16 KBytes,
8 Sectors of 2KBytes and 16384 Sectors of 8KBytes
0x00000010, 0x00000400, // 16 Sectors of 1KBytes
0x00000080, 0x00004000, // 128 Sectors of 16 KBytes
0x00000008, 0x00000800, // 8 Sectors of 2KBytes
0x00004000, 0x00002000, // 16384 Sectors of 8KBytes
0x00000000, 0x00000000, // end
*/
*************************************************************************************************************************
A part of my z_flash_W25QXXX.h file :
// here values for the W25Q128JV chips
#define EXT_FLASH_PAGE_SIZE 0x0100 //256b page size (bits)
#define EXT_FLASH_SECTOR_SIZE 0x1000 //4kB sector size (bytes)
#define EXT_FLASH_BLOCK_SIZE 0x00010000 //64kB block size (bytes)
#define EXT_FLASH_SIZE 0X01000000 //16MB-128Mb total size (bytes)
#define EXT_FLASH_PAGE_NUM 0x00010000 //32768 pages
#define EXT_FLASH_SECTOR_NUM 0x1000 //4096 sectors
#define EXT_FLASH_BLOCK_NUM 0x0100 //256 blocks
Best Regards,
STlinkos
2024-01-05 09:40 AM
You can output diagnostic output via a convenient serial UART or LEDs on the board to understand what's going on internally.
Would suggest testing the code externally in an application or framework you can drive and debug in a more usual way. Once tested there move to the External Loader model.
Data pages can only be written up to 256 bytes at a time, and those need to be page aligned, and not cross page boundaries.
This should be a suitable pin configuration for a NUCLEO-144 based fixture using the normal QSPI pins.
2024-01-06 10:10 AM
Hello @Tesla DeLorean,
i tried with the example https://github.com/cturvey/stm32extldr/blob/main/f7_w25q128/CLIVEONE-W25Q128_STM32F7XX-PB2-PB6-PD11-PD12-PE2-PD13.stldr and i had this error when i try to downlaod a bin file(i tried with a lot of bin file i have "Error: Data mismatch found at address 0x90000000 (byte = 0xXX instead of 0xXX") :
18:57:07 : Download verified successfully
18:57:49 : Memory Programming ...
18:57:49 : Opening and parsing file: stm32wb5x_Zigbee_FFD_fw.bin
18:57:49 : File : stm32wb5x_Zigbee_FFD_fw.bin
18:57:49 : Size : 332.16 KB
18:57:49 : Address : 0x90000000
18:57:49 : Erasing memory corresponding to segment 0:
18:57:49 : Erasing external memory sectors [0 5]
18:57:50 : Download in Progress:
18:57:53 : File download complete
18:57:53 : Time elapsed during download operation: 00:00:04.247
18:57:53 : Verifying ...
18:57:53 : Read progress:
18:57:55 : Error: Data mismatch found at address 0x90000000 (byte = 0x9A instead of 0x16)
18:57:55 : Error: Download verification failed
hardware config :
Best Regards,
Stlinkos
2024-01-06 10:34 AM
@Stlinkos So look... you have these pins NOT connected: PE2, PD13. The stldr expects them to work.
2024-01-06 03:05 PM
Try this, should be a 2-pin variant https://github.com/cturvey/stm32extldr/blob/main/f7_w25q128/CLIVEONE-W25Q128_STM32F7XX-PB2-PB6-PD11-PD12.stldr
If this doesn't work I'll need to break out a fixture and do some more testing
2024-01-09 02:50 AM
Hello @Tesla DeLorean , @Pavel A. , @KDJEM.1 ,
Finally, i connected: PE2, PD13 and used https://github.com/cturvey/stm32extldr/blob/main/f7_w25q128/CLIVEONE-W25Q128_STM32F7XX-PB2-PB6-PD11-PD12-PE2-PD13.stldr.
The load and read work if i use stm32programmer (i create and bin file, load it and read the right data) but if i use stm32cubeIde and touchgfx i have problem with the displaying.
I add the stdlr file in my project and setting the run configurations like :
The datas are in the flash memory :
The configuration of my touchgfx is
The Background image is not in the flash it works but the others in flash doesn't.
this what i have
Do you have any idea why my image in flash is wrong.
Best Regards,
Stlinkos