Tool/software:
Hello Team,
I have the example case provided by TI which reads 0x00001000 address and allows the read operation to be done without any issues.
Now trying to read data starting from 0x41D00000 region.
While trying to change it to read starting from 0x41D00000 using this modified function 'EEPROM_TypeA_IncReadData' please find the attached file for eeprom_emulation_type_a.c file for reference.
Please help me resolve this. Are there any other specific procedures to be followed for this read?
Thanks.
/*
* Copyright (c) 2021-24, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <ti/eeprom/emulation_type_a/eeprom_emulation_type_a.h>
#include "ti_msp_dl_config.h"
/* Address in main memory to write to. This is defined in the
* eeprom_emulation_type_a.h header file. Uncommenting the #define below will
* overwrite the default #define in the header file. */
#define SECTOR_SIZE (1024)
#define NUMBER_OF_WRITES ((SECTOR_SIZE / EEPROM_EMULATION_DATA_SIZE) + 1)
uint32_t DataArray[EEPROM_EMULATION_DATA_SIZE / sizeof(uint32_t)] = {
0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678,
0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321,
0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678,
0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321,
0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678};
uint32_t EEPROMEmulationBuffer[EEPROM_EMULATION_DATA_SIZE / sizeof(uint32_t)];
#pragma clang section bss=".eeprom_bss"
#pragma clang section text=".eeprom_text"
uint32_t rec_data[7];
#pragma clang section bss=""
#pragma clang section text=""
uint32_t BLANKAPISTATE;
uint32_t DATABLANKSTATE;
uint32_t gData32 = 0xABCDEF00;
volatile DL_FLASHCTL_COMMAND_STATUS gCmdStatus;
static volatile uint8_t var_test = 0xffu;
int main(void)
{
uint32_t EEPROMEmulationState;
SYSCFG_DL_init();
for (uint16_t num = 0;
num < EEPROM_EMULATION_DATA_SIZE / sizeof(uint32_t); num++) {
EEPROMEmulationBuffer[num] = DataArray[num];
}
while(1)
{
__BKPT(0);
switch(var_test)
{
case 5:
EEPROM_TypeA_IncReadData(0x41D00004, &rec_data[1], 1);
var_test = 0xff;
break;
case 6:
EEPROM_TypeA_IncReadData(0x41D00000, &rec_data[0], 1);
var_test = 0xff;
break;
}
__BKPT(0);
}
while(1) {
__WFI();
}
}
/*
* Copyright (c) 2021-24, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <ti/eeprom/emulation_type_a/eeprom_emulation_type_a.h>
#include "ti_msp_dl_config.h"
/* Address in main memory to write to. This is defined in the
* eeprom_emulation_type_a.h header file. Uncommenting the #define below will
* overwrite the default #define in the header file. */
#define SECTOR_SIZE (1024)
#define NUMBER_OF_WRITES ((SECTOR_SIZE / EEPROM_EMULATION_DATA_SIZE) + 1)
uint32_t DataArray[EEPROM_EMULATION_DATA_SIZE / sizeof(uint32_t)] = {
0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678,
0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321,
0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678,
0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321,
0xABCDEF00, 0x12345678, 0x00FEDCBA, 0x87654321, 0xABCDEF00, 0x12345678};
uint32_t EEPROMEmulationBuffer[EEPROM_EMULATION_DATA_SIZE / sizeof(uint32_t)];
#pragma clang section bss=".eeprom_bss"
#pragma clang section text=".eeprom_text"
uint32_t rec_data[7];
#pragma clang section bss=""
#pragma clang section text=""
uint32_t BLANKAPISTATE;
uint32_t DATABLANKSTATE;
uint32_t gData32 = 0xABCDEF00;
volatile DL_FLASHCTL_COMMAND_STATUS gCmdStatus;
static volatile uint8_t var_test = 0xffu;
int main(void)
{
uint32_t EEPROMEmulationState;
SYSCFG_DL_init();
for (uint16_t num = 0;
num < EEPROM_EMULATION_DATA_SIZE / sizeof(uint32_t); num++) {
EEPROMEmulationBuffer[num] = DataArray[num];
}
while(1)
{
__BKPT(0);
switch(var_test)
{
case 5:
EEPROM_TypeA_IncReadData(0x41D00004, &rec_data[1], 1);
var_test = 0xff;
break;
case 6:
EEPROM_TypeA_IncReadData(0x41D00000, &rec_data[0], 1);
var_test = 0xff;
break;
}
__BKPT(0);
}
while(1) {
__WFI();
}
}
