EmbSys Register addresses are wrong after compilation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EmbSys Register addresses are wrong after compilation

435 Views
kagoshi
Contributor I

Hello all!

I am running S32DS Power 2.1 version, on a MPC5744P Z4 devboard.
While using the FlexPWM, I have noticed, with the help of the debugger, that the register addresses to which the code writes are wrong. For instance, when I try to write to CTRL1, it writes to CTRL2 instead. Or when I try to write to CTRL2, it writes to CTRL1 instead. Or even when I try to write to OUTEN, it writes to the register immediately next to it, MASK.

For some time this drove me insane, how could such simple code not work, until I used the EmbSys Registers debugger (kudos to that. it is extremely useful).

Another problem is within the registers themselves. I noticed that in the FlexPWM reigsters, the bit positions are flipped, as in bit 0 is actually 15, bit 1 is actually 14, and so on. In the following image compare what is written on the Reference Manual, and what the EmbSys viewer shows. However, upon inspection of MPC5744P.h, everything looks file.2021-03-02 00_00_25-MPC5744PRM.pdf - [MPC5744P, MPC5744P Reference Manual] - SumatraPDF.png2021-03-02 00_00_10-workspaceS32DS.Power.2.1 - Debug - FirstProject_src_ExtLed.c - S32 Design Studio.png

0 Kudos
0 Replies