Part Number: TMS570LS3137
Hi,
I am trying to use an S29GL256S asynchronous memory on the EMIF interface of the TMS570, but only half of the flash (16MB) is accessible. Start address of flash is 0x60000000, and can access until address 0x60FFFFFF.
According to the TMS570 reference manual on page 637 "Additionally, when the EMIF interfaces to a 16-bit asynchronous device, the EMIF_BA[0] pin can serve as the upper address line EMIF_A[22]."
Also if EMIF_BA[1] provides least significant bit of the address, that means the the EMIF has effectively 24 address lines (BA[0], A21-A0, BA[1]), So it should be able to address 2^24 (16M Addresses).
Since the memory is 16bit (each location has 2 bytes of data), 16M Addresses Corresponds to 32MB of data.
When i try to access address location from 0x600000000 to 0x60FFFFFF, lines A21-A0, BA[1] toggles to provide physical addresses from 0 to 8M of the memory as expected.
But as soon as it try to write at location 0x61000000, there is no activity on the bus, and when i try to read from the same location i get Data abort.
Following is the code i am using. Please note that device type is set to MPU_DEVICE_NONSHAREABLE and access type is MPU_PRIV_RW_USER_RW_EXEC.
/* USER CODE BEGIN (0) */
#include "Lld_s29gl256s.h"
#include "sys_mpu.h"
#include "sys_core.h"
/* USER CODE END */
/* Include Files */
#include "sys_common.h"
/* USER CODE BEGIN (1) */
/* USER CODE END */
/** @fn void main(void)
* @brief Application main function
* @note This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/
/* USER CODE BEGIN (2) */
/* USER CODE END */
int main(void)
{
/* USER CODE BEGIN (3) */
_mpuInit_();
_mpuEnable_();
emif_ASYNC1Init();
uint16_t *base_addr = (uint16_t *) 0x60000000;
uint16_t data1 = 0x1234;
uint16_t data2 = 0x5678;
uint16_t Read_back_data;
/* Initialize all the Global Variables to Initial values*/
lld_ResetCmd((FLASHDATA *)0X60000000);
// send erase chip command
lld_ChipEraseCmd((FLASHDATA *)0X60000000);
*((uint16_t *) base_addr + 0x555) = 0x00AA; /* write unlock cycle 1 */
*((uint16_t *) base_addr + 0x2AA) = 0x0055; /* write unlock cycle 2 */
*((uint16_t *) base_addr + 0x555) = 0x00A0; /* write program setup command */
*((uint16_t *) 0x60000000) = data1; /* write data to be programmed */
Read_back_data = *((uint16_t *) 0x60000000);
*((uint16_t *) base_addr + 0x555) = 0x00AA; /* write unlock cycle 1 */
*((uint16_t *) base_addr + 0x2AA) = 0x0055; /* write unlock cycle 2 */
*((uint16_t *) base_addr + 0x555) = 0x00A0; /* write program setup command */
*((uint16_t *) 0x61000000) = data2; /* write data to be programmed */
Read_back_data = *((uint16_t *) 0x61000000);-------------------------------------> DATA ABORT EXCEPTION
return 0;
}
/* USER CODE BEGIN (4) */
/* USER CODE END */
----------------------------------------------------------------------------------------------------------------------------------------
void emif_ASYNC1Init(void) { /* USER CODE BEGIN (4) */ /* USER CODE END */ emifREG->CE2CFG = 0x00000000U; emifREG->CE2CFG = (uint32)((uint32)0U << 31U)| (uint32)((uint32)0U << 30U)| (uint32)((uint32)15U << 26U)| (uint32)((uint32)63U << 20U)| (uint32)((uint32)7U << 17U)| (uint32)((uint32)15U << 13U)| (uint32)((uint32)63U << 7U)| (uint32)((uint32)7U << 4U)| (uint32)((uint32)0U << 2U)| (uint32)((uint32)emif_16_bit_port); emifREG->AWCC = (emifREG->AWCC & 0xC0FF0000U)| (uint32)((uint32)emif_pin_high << 29U)| (uint32)((uint32)emif_pin_low << 28U)| (uint32)((uint32)emif_wait_pin0 << 16U)| (uint32)((uint32)0U); emifREG->PMCR = (emifREG->PMCR & 0xFFFFFF00U)| (uint32)((uint32)0U << 2U)| (uint32)((uint32)emif_8_words << 1U)| (uint32)((uint32)0U); /* USER CODE BEGIN (5) */ /* USER CODE END */ }
MMU Setting
Following is the connection i am using
How to resolve this Issue?

