This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AC6 peripheral register structural access issues

Hi,

I have trouble accessing registers with structures which work with AC5.

Below is the structure definition.

/*---------------------------------------------------------------------------*/
/* ADC Filter Configuration Register
* Address: 0x40030018, Reset: 0x00000007, Name: ADCFLT
*/
typedef struct {
unsigned int SF_6_0 :7;
unsigned int NOTCH2_7 :1;
unsigned int AF_13_8 :6;
unsigned int RAVG2_14 :1;
unsigned int CHOP_15 :1;
unsigned int SINC4_EN_16 :1;
unsigned int RSVD_17_31 :15;
} ADCFLT_t;

#define ADCFLT_A 0x40030018
#define GET_ADCFLT_PTR() ((ADCFLT_t*)(ADCFLT_A))

The result compiled by compiler 5.06 is attached below. The register is set correctly with value 0x961F.

And this is the result by compiler 6.15. The register value is incorrect.

 

Here is the generated AC6 asm code. 

Did anyone experience this issue?

Thanks

Bruce

Parents
  • My guess is that register should be accessed using 32-bit instructions since it is a 32-bit register.  The SoC's manual might tell you or it might not.  I can't see the ASM for 5.06, but I bet it used 32-bit writes.  ARM Compiler 6.12 was working fine and when upgrading to 6.15, I ran into a similar problem.  I *think* this might be resolved in 6.16 though I haven't tested it.  If you search for SDCOMP-54072 in the release notes, it seems related.

Reply
  • My guess is that register should be accessed using 32-bit instructions since it is a 32-bit register.  The SoC's manual might tell you or it might not.  I can't see the ASM for 5.06, but I bet it used 32-bit writes.  ARM Compiler 6.12 was working fine and when upgrading to 6.15, I ran into a similar problem.  I *think* this might be resolved in 6.16 though I haven't tested it.  If you search for SDCOMP-54072 in the release notes, it seems related.

Children
No data