I will be using Keil for my project. What are the common problems or pitfalls that I may encounter?
Keil is Big Endian
Keil stores the most-significant byte of a multi-byte variable in the lowest address. This means an unsigned integer variable of value 0xA569 located at address 0x40 will be stored such that 0xA5 is at address location 0x40 and 0x69 is stored at 0x41.
This also means that unions are stored where byte 0 is the MSB. For example:
In this union, U8 accesses the MSB of the U16 value, and U8 accesses the LSB of the U16 value.
Variables Declared with 'const'
In version 8 of Keil, variables declared as const are not explicitly assumed to be code variables, meaning that they will be copied into the default memory segment based on the memory model of the project. In version 7 of Keil, however, const variables were placed in code, even if code wasn't explicitly declared. The common result of this is that a project working with version 7 receives a 'memory segment overflow' error when compiled with Keil version 8. The solution is to add the code specifier immediately after the const specifier.