Part Number: TMS570LS3137 Hello , Can you send me the entire CCS project that you have working for S29Gl512N - 110 ns - 64 MBytes that you discussed in following thread with NORflash.c NORflash.h and also emif.c emif.h . I referring to your post on E2E https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/712728?CCS-RM57L843-NOR-Flash-read-and-write . I am using the NORflash.c file , I see your signature . /* * NOR Flash Code * By QJ Wang * March 19, 2012 */ We are working with larger application size of 6 MB so we needed S29Gl512N 32 MB NOR FLASH to store the application . On our board we provided 64 MB EMIF SDRAM and 32 MB EMIF NOR FLASH . I am using NOR FLASH to Load and store the Application ( like Hard Disk ), to run or execute I load contents of 32MB NOR FLASH to SDRAM and Execute from SDRAM . I am using same chip as you discussed and implemented for S29Gl512N . I am using the attached NOR FLASH Driver .c that is available on E2E . But I am unable to find the norFlash.h file for the same . I understand the NOR flash is different from SDRAM chip . And access mechanism is also different . I am also following the thread https://e2e.ti.com/support/microcontrollers/hercules/f/312/p/731212/2701876?tisearch=e2e-sitesearch&keymatch=NOR%20Flash%20Code#2701876 to implement the same and test the NOR FLASH . Boot_NORFlash.c Additionally I executing following API procedure MENTIONED BELOW , I am using NOR Flash Command Summary as in the following document . CYPRESS NOR FLASH COMMAND SUMMARY.pdf uint16_t FLASH_write( uint32_t src, uint32_t dst, uint32_t length ) { uint32_t i; uint8_t* psrc8; uint16_t* pdst16; uint8_t extra_byte_to_write; uint16_t full_word_to_write = 0; uint8_t* lower_byte_to_write = ( uint8_t* )( &full_word_to_write ); uint8_t* upper_byte_to_write = ( uint8_t* )( &full_word_to_write + 1 ); /* Align to 16-bit Flash memory */ if ( ( dst & 1 ) == 1 ) { *lower_byte_to_write = *( uint8_t* )( dst - 1 ); *upper_byte_to_write = *( uint8_t* )( src ); FLASH_write( ( uint32_t )&full_word_to_write, dst - 1, 2 ); dst = dst + 1; src = src + 1; length = length - 1; } /* * Align to 8 or 16 bits */ extra_byte_to_write = length & 1; psrc8 = ( uint8_t* )src; pdst16 = ( uint16_t* )dst; length &= 0xFFFFFFFE; for ( i = 0 ; i > 8; FLASH_write( ( uint32_t )&full_word_to_write, ( uint32_t )pdst16, 2 ); } /* * Set to Read Mode */ FLASH_BASE_PTR8 = FLASH_RESET; return 0; } uint16_t FLASH_read( uint32_t src, uint32_t dst, uint32_t length ) { uint32_t i; uint16_t* psrc16 = ( uint16_t* )src; uint16_t* pdst16 = ( uint16_t* )dst; /* * Set to Read Mode */ FLASH_BASE_PTR8 = FLASH_RESET; /* * Read Data to Buffer */ for ( i = 0 ; i < length ; i += 2 ) *pdst16++ = *psrc16++; return 0; } void program_word() { uint16_t *base_addr = (uint16_t *)0x60000000; uint16_t *pa = (uint16_t *)0x60000100; uint16_t data = 0x1234; *( (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 *)pa ) = data; /* write data to be programmed */ } void program_word_one() { uint16_t *base_addr = (uint16_t *)0x60000000; uint16_t *pa = (uint16_t *)0x60000100; uint16_t data = 0x1234; *( (uint16_t *)base_addr + 0xAAA ) = 0x00AA; /* write unlock cycle 1 */ *( (uint16_t *)base_addr + 0x554 ) = 0x0055; /* write unlock cycle 2 */ *( (uint16_t *)base_addr + 0xAAA) = 0x00A0; /* write program setup command */ *( (uint16_t *)pa ) = data; /* write data to be programmed */ }
↧