Hello,
I am trying code a custom board with TZ1001 toshiba microcontroller in it. I have to store the sensor values connected to TZ1001 in internal NOR flash with time a stamp. I am able to write the vaalues to flash properly, but when i try to read the values from flash then it is giving some random constant value. I am attaching the code, where it starts writing to flash when typed ‘a’ and reads when typed ‘b’.
~~~
void tmp006
demotask(void *pvParameters)
{
i2c_initialize();
char input;
uint32_t i;
ifdef NORUSESDMAC
Driver
SDMAC.Initialize();
DriverSDMAC.PowerControl(ARM
POWERFULL);
endif
rtn = drv_info->Initialize(0);
rtn = drv
info->PowerControl(ARMPOWER_FULL);
input = prompt_console("select");
if ((input >= 'A') && (input <= 'Z'))
{
input = input + ('a' - 'A');
}
while(1)
{
if (input == ‘a’)
{
read
temp();
sramarea[i] = (int)temperature;
vTaskDelay(1000);
rtn = drv_info->WriteData(WRITE_ADDRESS, sram_area, sizeof(sram_area));
print_sp(PREF "DATA WRITE rtn=%d data=0x%02x rn", rtn, *sram_area);
print_sp(PREF "MEM VALUE 0x%08xrn", (ptr+=2));
}
if (input == 'b')
{
rtn = drv_info->ReadData(WRITE_ADDRESS, hts_measurement1 , 1);
print_sp(PREF "DATA READ rtn=%d %d rn",rtn, hts_measurement1[0]);
vTaskDelay(1000);
}
}
}
~~~
sram
area and htsmeasurement are two array variables of integer data types declared globally.
I request someone to help me on this, as i am stuck in this from many days.