Reading/writing internal flash DA14583

3 posts / 0 new
Last post
jacobnordgren1
Offline
Last seen:3 years 2 months ago
加入ed:2016-06-13 09:45
Reading/writing internal flash DA14583

Hello.

We are currently building an application that will require some storage and were hoping that we could use some parts of the internal 1 Mbit flash memory in the DA14583.
Problem is that we can't seem to get the memory to respond.
Currently this is the setup code in the periph_setup.c

// configure internal flash GPIOS
GPIO_ConfigurePin( DA14583_SPI_FLASH_EN_GPIO_PORT, DA14583_SPI_FLASH_EN_GPIO_PIN, OUTPUT, PID_SPI_EN, true );
GPIO_ConfigurePin( DA14583_SPI_FLASH_CLK_GPIO_PORT, DA14583_SPI_FLASH_CLK_GPIO_PIN, OUTPUT, PID_SPI_CLK, false );
GPIO_ConfigurePin( DA14583_SPI_FLASH_DO_GPIO_PORT, DA14583_SPI_FLASH_DO_GPIO_PIN, OUTPUT, PID_SPI_DO, false );
GPIO_ConfigurePin( DA14583_SPI_FLASH_DI_GPIO_PORT, DA14583_SPI_FLASH_DI_GPIO_PIN, INPUT, PID_SPI_DI, false );

cs_pad_param.port = DA14583_SPI_FLASH_EN_GPIO_PORT;
cs_pad_param.pin = DA14583_SPI_FLASH_EN_GPIO_PIN;

// Initialize SPI driver
spi_init(&cs_pad_param, SPI_MODE_8BIT, SPI_ROLE_MASTER, SPI_CLK_IDLE_POL_LOW, SPI_PHA_MODE_0, SPI_MINT_DISABLE, SPI_XTAL_DIV_8);
// Initialize SPI Flash driver
spi_flash_init(DA14583_SPI_FLASH_SIZE, DA14583_SPI_FLASH_PAGE_SIZE);

(taken from one of the example projects)

And then to actually to write and read, this:

uint8_t* buff = "string";
spi_flash_write_data (buff, 0x00,6);
printf("Wrote ! ");
memset(buff,0,6);

spi_flash_read_data(buff,0x00,6);
printf("读:% s r \ n \”,迷);

Also testing the spi_flash_auto_detect() always returns SPI_FLASH_AUTO_DETECT_NOT_DETECTED

So questions:
- Can we read/write the internal flash from code or are we limited to smart snippets?
- If so any ideas as to what we are doing wrong?

//
Jacob

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
加入ed:2015-06-08 11:34
Hi jacobnordgren1,

Hi jacobnordgren1,

Most probably you have the internal flash device disabled (its in power off state). Please check the below thread at #6 post.

http://support.dialog-semiconductor.com/unable-read-da14583-internal-fla...

Thanks MT_dialog

jacobnordgren1
Offline
Last seen:3 years 2 months ago
加入ed:2016-06-13 09:45
Thank you for your quick

Thank you for your quick response.

I did actually have the release power call in there i just missed it when pasting the code.

Our problem has however been resolved by connecting the SPI_5V to BATS on the dev-board...

Thank you very much for your help though!

//
Jacob

Topic locked