You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by will sanfilippo <wi...@runtime.io> on 2016/12/16 22:17:44 UTC

NXP sdk and newt tool issues

Hello:

While adding support for a new NXP processor (the MKW41Z) I have run into a bit of an issue and not sure the best way to resolve it.

The NXP mcu support currently has one device in it: the MK64F12. If you go into the hw/mcu/nxp directory there is a SDK package in that dir. The basic structure of the SDK is this:

src/ext/sdk-2.0-frdm-k64f_b160321/devices/<DEVICE>

Currently, there is one device in there (the MK64F12). When I went to add a new device (the mkw41z) I ran into the following issue. There is a file called fsl_device_registers.h. This header file exists in both device directories. When I went to build the mkw41z it was including fsl_device_registers.h from MK64F12; not mkw41z.

This was in the old pkg.yml file:

pkg.src_dirs:
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/MK64F12"
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/MK64F12/drivers"
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/MK64F12/gcc"
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/MK64F12/utilities"

I was hoping that this would work (it did not):

pkg.src_dirs.BSP_MK64F12:
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/MK64F12"
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/MK64F12/drivers"
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/MK64F12/gcc"
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/MK64F12/utilities”

pkg.src_dirs.BSP_MKW41Z:
    - "src/ext/sdk-2.0-frdm-k64f_b160321/devices/mkw41z"

I do not understand how the newt tool determines include paths from an sdk pkg.yml file so maybe there is way I can do this. Of course, I could create separate sdk packages but I do not think that is the right way to go. I could also move the needed code into hw/mcu/nxp/<DEVICE>/ but I do not think that is the best way to solve this, either.

Any thoughts/suggestions on how to deal with this?

Thanks!















Re: NXP sdk and newt tool issues

Posted by will sanfilippo <wi...@runtime.io>.
I could be wrong, but I think I was told that would not change the include paths. There is another possible issue with this: the normal SDK includes tons of devices. If we were to take the SDK in its entirety it would be a pain to specify all the directories to be ignored. However, this would certainly work for now… assuming it works :-) Will give it a go.


> On Dec 16, 2016, at 2:30 PM, marko kiiskila <ma...@runtime.io> wrote:
> 
> Hi Will,
> 
>> On Dec 16, 2016, at 2:17 PM, will sanfilippo <wi...@runtime.io> wrote:
> ...
>> Currently, there is one device in there (the MK64F12). When I went to add a new device (the mkw41z) I ran into the following issue. There is a file called fsl_device_registers.h. This header file exists in both device directories. When I went to build the mkw41z it was including fsl_device_registers.h from MK64F12; not mkw41z.
> 
> ...
> 
>> 
>> I do not understand how the newt tool determines include paths from an sdk pkg.yml file so maybe there is way I can do this. Of course, I could create separate sdk packages but I do not think that is the right way to go. I could also move the needed code into hw/mcu/nxp/<DEVICE>/ but I do not think that is the best way to solve this, either.
>> 
>> Any thoughts/suggestions on how to deal with this?
> 
> How about pkg.ign_dirs to ignore subdirectories in the NXP SDK?
> Making them conditional on the MCU type, like you tried to do with the src_dirs.


Re: NXP sdk and newt tool issues

Posted by marko kiiskila <ma...@runtime.io>.
Hi Will,

> On Dec 16, 2016, at 2:17 PM, will sanfilippo <wi...@runtime.io> wrote:
...
> Currently, there is one device in there (the MK64F12). When I went to add a new device (the mkw41z) I ran into the following issue. There is a file called fsl_device_registers.h. This header file exists in both device directories. When I went to build the mkw41z it was including fsl_device_registers.h from MK64F12; not mkw41z.

...

> 
> I do not understand how the newt tool determines include paths from an sdk pkg.yml file so maybe there is way I can do this. Of course, I could create separate sdk packages but I do not think that is the right way to go. I could also move the needed code into hw/mcu/nxp/<DEVICE>/ but I do not think that is the best way to solve this, either.
> 
> Any thoughts/suggestions on how to deal with this?

How about pkg.ign_dirs to ignore subdirectories in the NXP SDK?
Making them conditional on the MCU type, like you tried to do with the src_dirs.