i made a small driver for eeprom as the driver on github dont work with me it gave me 3 error undefined symbol SysctlDelay ,,, undefined symbol Sysctlperipheralreset ,,,,,,,, undefined symbol main
so i made my own driver but it has a problem when i run the code on keil the EEPROM base register and offset register points to the same memory part all the time which means when i write on the register EEDRW IT changes and store in the memory location but when i rewrite on it after increaminting the offset and block it doeasnt change the memory part and then it rewrites on the old data here is a copy of mt test code note that there are many hard coded part as iam testing note that aslo i open the memory from the simulator in keil in the systejm viewer memory 1
#include "tm4c123gh6pm.h"
#include <stdint.h>
#define EE 0x00000
volatile uint32_t *hwreg_ptr;
void delay(uint32_t n){
while (n>0){
n-- ;
}
}
void EEPROM_wait_for_write(void) {
while( EEPROM_EEDONE_R !=0X00) ;
}
void EEPROM_wait_for_done(void){
while( EEPROM_EEDONE_R !=0X0) ;
}
uint32_t EEPROM_Init() {
delay(6);
SYSCTL_RCGCEEPROM_R |= 0x01;
EEPROM_wait_for_done();
while( (EEPROM_EESUPP_R & 0x0C) != 0)
{
return(-1);
}
SYSCTL_SREEPROM_R |= 0x01 ;
delay(6);
while( (EEPROM_EESUPP_R & 0x0C) != 0)
{
return(-1);
}
EEPROM_wait_for_done();
while( (EEPROM_EESUPP_R & 0x0C) != 0)
{
return(-1);
}
return 0 ;
}
void EEPROM_Write(char *data,uint32_t address,uint32_t bytes)
{
uint32_t block= 0 ;
uint32_t offset = address % 4 ;
uint32_t i ;
uint32_t k = 0 ;
uint32_t words = bytes /4 ;
uint32_t Byte_Num = 4 ;
EEPROM_EEOFFSET_R =8 ;
EEPROM_EEBLOCK_R = 8 ;
EEPROM_EERDWR_R = EE;
for( i = 0 ; i < words ; i++){
if(offset ==16)
{ block ++ ;
offset = 0 ;
}
for ( k=0 ; k <= 3 ; k++)
{
EEPROM_EERDWR_R |= data[k] ;
delay(10);
EEPROM_wait_for_write();
if(k != (Byte_Num - 1)){
EEPROM_EERDWR_R = EEPROM_EERDWR_R << 8 ;
}
}
EEPROM_wait_for_write();
offset++ ;
EEPROM_EEOFFSET_R = offset ;
// 0x400A0000,0x400FFFFF
}
EEPROM_wait_for_done();
delay(10);
}
int main ()
{
uint32_t x = 0x400AFA12 ;
char myString[] = "ABF";
EEPROM_Init() ;
EEPROM_Write(myString ,x,8);
EEPROM_EERDWR_R = EE;
while(1){}
}
so could you please help me in solving only one of these 2 problems i use tm4c123gh6pm