You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Karel Kočí <ka...@nic.cz> on 2022/01/31 14:34:46 UTC

arm/kinetis vs arm/kl

Hi everyone

I am trying to port NuttX to NXP KL8xZ chips. I already did memory map, irq, 
pinmux, rom config and other tweaks but now when I want to get UART up and 
running I kind of started thinking if I am doing the right thing. Let me 
explain...

I forked kl25z support in hopes that it is closest to the kl81z. It is from same 
series, it is also based on Cortex-M0+ (armv6). But it is not exactly smooth 
saling (although I did not expect it would be). The system integration module 
has a bit different layout but most notably there are different peripherals. For 
example lpuart is not implemented in lp but the implementation in kinetis is 
pretty much spot on.

My original understanding was that arm/kinetis is intended for armv7 and arm/kl 
for amv6. Thus, my question is: is that true? Or is it just some historical 
division?

I can now either move the whole fork to the kinetis directory (and work out 
armv6 vs 7 switch) and use already implemented drivers there, or I can copy 
drivers to kl directory. What do you think is the best course of action?

Any hint or suggestion is appreciated.
With regards
Karel Koci

RE: arm/kinetis vs arm/kl

Posted by David Sidrane <da...@nscdg.com>.
Hi Karel,

It depends on the level of intrusion. You are closer to the problem then I
am. So, I will share what I know and hopefully a clear path will emerge for
you. I do not know the history of the KL.

The Kinetis arch has a notion of IP versioning. See
https://github.com/apache/incubator-nuttx/blob/master/arch/arm/include/kinetis/kinetis_mcg.h#L35-L48
and
https://github.com/apache/incubator-nuttx/blob/master/arch/arm/include/kinetis/kinetis_sim.h#L34-L51
for some references. If the code can be added using or extending notion of
IP versioning that is the way to go. It reduces ifdef rash to features not
chips.

If the KL8xZ is closer to the KL than the Kinetis. it would be fine to copy
over the IP drivers from the Kinetis to the KL. This is preferred to reduce
coupling and ifdef rash. The maintenance effort is higher, but the
decoupling avoids a break-it fix-it loop we have seen on STM32.

Regard,

David


-----Original Message-----
From: Karel Kočí <ka...@nic.cz>
Sent: Monday, January 31, 2022 6:35 AM
To: dev@nuttx.apache.org
Subject: arm/kinetis vs arm/kl

Hi everyone

I am trying to port NuttX to NXP KL8xZ chips. I already did memory map, irq,
pinmux, rom config and other tweaks but now when I want to get UART up and
running I kind of started thinking if I am doing the right thing. Let me
explain...

I forked kl25z support in hopes that it is closest to the kl81z. It is from
same series, it is also based on Cortex-M0+ (armv6). But it is not exactly
smooth saling (although I did not expect it would be). The system
integration module has a bit different layout but most notably there are
different peripherals. For example lpuart is not implemented in lp but the
implementation in kinetis is pretty much spot on.

My original understanding was that arm/kinetis is intended for armv7 and
arm/kl for amv6. Thus, my question is: is that true? Or is it just some
historical division?

I can now either move the whole fork to the kinetis directory (and work out
armv6 vs 7 switch) and use already implemented drivers there, or I can copy
drivers to kl directory. What do you think is the best course of action?

Any hint or suggestion is appreciated.
With regards
Karel Koci