Sat 12 Mar 2011 04:24:54 AM UTC, comment #4:
Eric:
>
>Now there are some other questions that need to be answered:
>
>- Does this data exist in current XML files? If not, it needs to be added
>for
>future new devices.
>
Part description XML files has the offset data. For e.g.,ATxmega6D3.xml has the following contents:
<register-group caption="Production Signatures" name="NVM_PROD_SIGNATURES">
<register caption="RCOSC 2MHz Calibration Value" name="RCOSC2M" offset="0x00"
size="1"/>
<register caption="RCOSC 32kHz Calibration Value" name="RCOSC32K" offset="0x02"
size="1"/>
<register caption="RCOSC 32MHz Calibration Value" name="RCOSC32M" offset="0x03"
>- Will you be creating a patch that adds this new information to existing
>header files?
>
Not necessarily. Particularly, I don't want manual changes to header files. It becomes difficult to maintain when they are regenerated. Since Bob's solution worked, the requirement for offsets is not an immediate requirement.
That said, I think introducing NVM_PROD_SIGNATURES_offsets_t in xmega headers might still be a good idea convenient to users.
>- The avrgcc-header script will also need to be updated/committed to handle
>the new XML file format, and to make sure that it handles this information
>and
>writes this enum to new XMEGA header files that conform to the points
>above.
Thanks
Anitha
|
Sat 12 Mar 2011 04:15:01 AM UTC, comment #3:
>From: Bob Paddock [mailto:graceindustries@gmail.com]
>Sent: Thursday, March 10, 2011 9:51 PM
>To: Anitha Boyapati
>Cc: Boyapati, Anitha; -unavailable-
>Subject: Re: [avr-libc-dev] [bug #32723] Add NVM_PROD_SIGNATURES_t in Xmega
>header files
...
>I don't see this change as needed, use 'offsetof' in stddef.
...
hex8( SP_ReadCalibrationByte( offsetof( NVM_PROD_SIGNATURES_t, WAFNUM ) ) );
---
I just tried it. It worked. Thanks Bob.
|
Wed 09 Mar 2011 03:09:18 PM UTC, comment #2:
Hi Anitha,
I don't know if you know this, but Kristian Hole has an account on Savannah; he can submit his own bug reports. ;-) He's done so before.
I think it's fine to add this information to the XMEGA header files, with just a couple of stylistic changes:
- The opening brace needs to be in line with the closing brace of the enum. We use the BSD style, not K&R style for brace placement. Like this:
typedef enum tag
{
...
} typename;
- We don't use the C++ style, single-line comments. We have to stick with the old C89 comments, like this: /* ... */. This is because avr-libc is designed to compile to older C standards. So this would have to change in the example that you gave.
Now there are some other questions that need to be answered:
- Does this data exist in current XML files? If not, it needs to be added for future new devices.
- Will you be creating a patch that adds this new information to existing header files?
- The avrgcc-header script will also need to be updated/committed to handle the new XML file format, and to make sure that it handles this information and writes this enum to new XMEGA header files that conform to the points above.
|
Wed 09 Mar 2011 07:03:03 AM UTC, original submission:
AVR-GCC has a NVM_PROD_SIGNATURES_t which contains all the registers of the production signature row. However, when loading from the signature row, you need the offset.
Can we please add an enum the same way as IAR does it?
/* Offset definitions for Production Signatures */
typedef enum NVM_PROD_SIGNATURES_offsets {
RCOSC2M_offset = 0x00, ///< RCOSC 2MHz Calibration Value
RCOSC32K_offset = 0x02, ///< RCOSC 32kHz Calibration Value
RCOSC32M_offset = 0x03, ///< RCOSC 32MHz Calibration Value
LOTNUM0_offset = 0x08, ///< Lot Number Byte 0, ASCII
LOTNUM1_offset = 0x09, ///< Lot Number Byte 1, ASCII
LOTNUM2_offset = 0x0A, ///< Lot Number Byte 2, ASCII
LOTNUM3_offset = 0x0B, ///< Lot Number Byte 3, ASCII
LOTNUM4_offset = 0x0C, ///< Lot Number Byte 4, ASCII
LOTNUM5_offset = 0x0D, ///< Lot Number Byte 5, ASCII
WAFNUM_offset = 0x10, ///< Wafer Number
COORDX0_offset = 0x12, ///< Wafer Coordinate X Byte 0
COORDX1_offset = 0x13, ///< Wafer Coordinate X Byte 1
COORDY0_offset = 0x14, ///< Wafer Coordinate Y Byte 0
COORDY1_offset = 0x15, ///< Wafer Coordinate Y Byte 1
ADCACAL0_offset = 0x20, ///< ADCA Calibration Byte 0
ADCACAL1_offset = 0x21, ///< ADCA Calibration Byte 1
ADCBCAL0_offset = 0x24, ///< ADCB Calibration Byte 0
ADCBCAL1_offset = 0x25, ///< ADCB Calibration Byte 1
TEMPSENSE0_offset = 0x2E, ///< Temperature Sensor Calibration Byte 0
TEMPSENSE1_offset = 0x2F, ///< Temperature Sensor Calibration Byte 0
DACAOFFCAL_offset = 0x30, ///< DACA Calibration Byte 0
DACACAINCAL_offset = 0x31, ///< DACA Calibration Byte 1
DACBOFFCAL_offset = 0x32, ///< DACB Calibration Byte 0
DACBGAINCAL_offset = 0x33, ///< DACB Calibration Byte 1
} NVM_PROD_SIGNATURES_offsets_t;
This goes for all XMEGA devices.
|