Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Doing the following -

#define CYDEV_EE_BASE 0x40008000u        // This is Creator generated

uint8   nSavedEE = 0;

I get a warning on line 420, but does not show up in warnings notice window after compile., Still stays however

when doing further code work. Warning shown below.

pastedImage_1.png

Regards, Dana.

0 Likes
1 Solution

Dana,

At first, the compiler converted the 32-bit (unsigned int) value 0x40008000 (1073774592) into a 16-bit (unsigned short) value 0x8000 (32768) to pass the value to the function EEPROM_ReadByte() as the argument.

The function receives a 16-bit value 0x8000 (32768) and calculates the actual address as following statement.

    retByte = *((reg8 *) (CYDEV_EE_BASE + address));

So, the returned value will be read from 0x40010000 which is a "Digital interconnect configuration" register area.

I don't know why you think the program is working fine.

But this is an incorrect use of EEPROM_ReadByte() function.

Anyway, EEPROM_WriteByte() function has a protection not to access an invalid address.  So, the "Digital interconnect configuration" are will not be destroyed.

Regards,

Noriaki

View solution in original post

0 Likes
4 Replies