In the File "MCIMX7D_M4.h" are the FTM bit positions in the right place

Hi,

Looking at the reference manual { 0.1, 08/2016 }, FTM registers are bit number [ 0:31 ] where the GPT registers are numbered [ 31:0 ], which also looks like the file listed above has all the wrong bit shifts and stuff for this specific module, how ever I am not sure who is responsible here, is it a document fault or coding fault?

Would anyone care to comment and may be throw so good light on this for me and others ?

All the best

Liam Dowling
PS has any one written an FTM example ?

It seems to me that the manual is using big endian format. I would guess that the bits are still at the “same” location, just that we access it in little endian. So in other words, the code is probably right and the documentation should have the bit labels inversed…

I do have some evidence to prove that, in U-Boot I use the following commands to enable FTM1 clock and read the reset value of all FTM1 registers:

Colibri iMX7 # mw.l 0x30384800 0x2
Colibri iMX7 # md.l 0x30640000 0x26
30640000: 00000000 00000000 00000000 00000000    ................
30640010: 00000000 00000000 00000000 00000000    ................
30640020: 00000000 00000000 00000000 00000000    ................
30640030: 00000000 00000000 00000000 00000000    ................
30640040: 00000000 00000000 00000000 00000000    ................
30640050: 00000000 00000004 00000000 00000000    ................
30640060: 00000000 00000000 00000000 00000000    ................
30640070: 00000000 00000000 00000000 00000000    ................
30640080: 00000000 00000000 00000000 00000000    ................
30640090: 00000000 00000000                      ........

According to the documentation, the reset value of register 0x54 (FTM1_MODE) has bit 29 set. In little endian that would be a high number, but as you can see the value is 0x00000004, which is bit 2 in little endian format.

We did not use the Flextimer module on FreeRTOS so far.

Bit positions in the documentation are wrong.

Ut seems to me that they copied the IP from a big endian machine and forgot to change the bit numbering in the documentation…

I agree with you, I guess I just needed that statement for confidence, thanks for your time Stefan

Hi Stefan,

Thanks for getting back to me on this one, I am writing a driver for my current package and I need to get this going.

looking at reference manual, section 1.9 Endianness Support;
i.MX 7D supports Little Endian mode only.

So are we saying the actual bit positions documented are wrong here or the code written is wrong, I interpret what your saying as the Document bit positions in the document are wrong ?

Could you please clarify for me ?

Thanks for your help so far

Liam Dowling