How can i read from flash in spc560b ?
Hi Friend
I want Read from speciefic address in flash and save it In ram and then write to another Address in flash. My problem is how can i read from flash.
I am waiting for your help
Hi Friend
I want Read from speciefic address in flash and save it In ram and then write to another Address in flash. My problem is how can i read from flash.
I am waiting for your help
Hi,
in order to read the Flash memory, it is enough to use a pointer to the address you want to read. The following code shows how to read the content of the flash memory at the address 0xFC0000.
/* Inclusion of the main header files of all the imported components in the
order specified in the application wizard. The file is generated
automatically.*/
#include "components.h"
/*
* Application entry point.
*/
int main(void) {
uint32_t flash_address_pointer = 0xFC0000;
vuint32_t flash_value;
flash_value = *((vuint32_t*)(flash_address_pointer));
/* Initialization of all the imported components in the order specified in
the application wizard. The function is generated automatically.*/
componentsInit();
/* Enable Interrupts */
irqIsrEnable();
/* Application main loop.*/
for ( ; ; ) {
printf("Address = 0x%08X - Value = 0x%08X\n\r", (unsigned int)flash_address_pointer, (unsigned int)flash_value);
pal_lld_togglepad(PORT_E, LED_4);
pal_lld_togglepad(PORT_A, LED_3);
pal_lld_togglepad(PORT_D, LED_5);
osalThreadDelayMilliseconds(250);
}
}Regards,
Luigi
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.