I am trying to read/write configuration data to the flash in my program. The configuration data is a 512 uint16_t array. I am following the "Using SDK6 Peripheral Drivers" doc. I tried to change the flash configuration to the on-board P25Q11U device on-board the module. The P25Q11U_DEV_INDEX is missing from the enum in spi_flash.h of known devices.
I have included spi_flash.c and spi_531.c drivers.
Is there a specific 14531MOD example or documentation I can follow or a different driver I am missing?
Thank you,
Larry
Device:
Should have included I am using SDK 6.0.14.1114 and the DA14531DIAKT.
我跟inued assuming the P25q11u is the same as the P25Q10U, I get the SPI_FLASH_ERR_WEL_ERROR error when I try a flash errase.
I also tried:
static const spi_flash_cfg_t spi_flash_cfg = {
.dev_index = P25Q10U_DEV_INDEX,
.jedec_id = P25Q11U_JEDEC_ID,
.chip_size = P25Q11U_CHIP_SIZE,
};
I added the following as recommended by the "DA14585/586 interfacing with external memory" application note for P25Q10U.
spi_set_bitmode(SPI_MODE_8BIT);
spi_transaction(0x06); //Write enable
spi_set_bitmode (SPI_MODE_16BIT);
//Write 00 to the status register, this disables all memory protection bits
spi_transaction(0x01 << 8);
Still the same error.
Thanks,
Larry
Hi lecarter190,
Thanks for your question. Please check out the SPI Flash SDK example : 6.0.14.1114\projects\target_apps\peripheral_examples\spi\spi_flash
This example aims to demonstrate how to perform the basic read/write functionalities. Just build the Keil project for DA14531 configuration and program the module. Additionally, the example sis using the UART ( UTX on P06), so place a jumper on J1.UTX to see the logging info on a serial terminal. The P25Q10U_DEV_INDEX is added on known_spi_devs_list[] structure and it is OK to interact with the on-module flash.
Thanks, PM_Dialog
Thanks,
The example does work, I will go thru it and see what I am missing in my code. I still don't see the Index for the 11U chip, but it works as coded.
Again,
Thanks
Got it, I am using the DA14531MOD and forgot to Reserve and GPIO_Configure the internal pins to the flash. Out of sight, out of mind.
Again,
Thanks
Hi lecarter190,
Glad that you got it working and thanks for accepting my answer.
Thanks, PM_Dialog