Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Internal NOR flash Read Issue in TZ1001

Posted by nitin92 on January 3, 2018

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 tmp006demotask(void *pvParameters) { i2c_initialize(); char input;

uint32_t i;

ifdef NORUSESDMAC

DriverSDMAC.Initialize(); DriverSDMAC.PowerControl(ARMPOWERFULL);

endif

rtn = drv_info->Initialize(0);

rtn = drvinfo->PowerControl(ARMPOWER_FULL);

    input = prompt_console("select");
  if ((input >= 'A') && (input <= 'Z'))
  {
    input = input + ('a' - 'A');
  }

while(1) { if (input == 'a') { readtemp(); 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 \r\n", rtn, *sram_area); 
     print_sp(PREF "MEM VALUE         0x%08x\r\n", (ptr+=2));
 }

 if (input == 'b')
 {
    rtn = drv_info->ReadData(WRITE_ADDRESS, hts_measurement1 , 1);
   print_sp(PREF "DATA READ       rtn=%d  %d  \r\n",rtn, hts_measurement1[0]);

   vTaskDelay(1000);
 }

}

} ~~~

sramarea 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.


Internal NOR flash Read Issue in TZ1001

Posted by rtel on January 3, 2018

Is this a FreeRTOS related question?


Internal NOR flash Read Issue in TZ1001

Posted by nitin92 on January 3, 2018

Yes I am coding it in free rtos platform!


Internal NOR flash Read Issue in TZ1001

Posted by rtel on January 3, 2018

Please elaborate on the FreeRTOS part of your question so we can assist with that. The NOR flash driver is not part of FreeRTOS.


Internal NOR flash Read Issue in TZ1001

Posted by heinbali01 on January 3, 2018

Although it seems that your question is not related to using FreeRTOS, I had a quick look at your code and found that a variable i is being used without initialising it:

~~~ uint32t i; while(1) { ... readtemp(); sram_area[i] = (int)temperature; ... } ~~~

You will write the contents of sram_area to flash, which is probably also uninitialised.


Internal NOR flash Read Issue in TZ1001

Posted by nitin92 on January 3, 2018

sram_area is a variable that is declared globally as an integer array.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Webinar

"OTA Update Security and Reliability" webinar presented by TI and AWS. Register here.


Careers

FreeRTOS and other embedded software careers at AWS.


Latest News

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner