NXP S32K1xx SDK - Integration with CMake

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

NXP S32K1xx SDK - Integration with CMake

406 Views
adan_pantoja
Contributor I

Hello all, 

Background:

  • SDK: v4.0.2
  • OS: freeRTOS

I am working on a project which uses the FlexIO module as a UART peripheral. For some time now I have been trying to figure out why my program breaks whenever it attempts to initialize the driver. As you can see in the picture below, the program will try to initialize it, but once it gets to the Mutex, something triggers an interrupt and goes to the WDOG handler. I wanted to point out that the WDOG is not enabled. 

adan_pantoja_0-1683640474597.png

After spending some time debugging, it turns out that the issue is caused by the way I link the flexio_uart_driver.c and flexio_common.c in my CMake. I currently have an nxp target to which I link all source code in the SDK with a PRIVATE scope. I then link the nxp target to my main application. For some reason, both of the files mentioned previously need to be linked to the NXP target using a PUBLIC scope; this resolves the issue. I am not sure why both the NXP target and my main application need to compile the source code. It does not make sense because it seems like there is some dependency issues when separating the source code into its own target. 

adan_pantoja_0-1683645197436.png

So my question is, when using CMake, why can't I follow a modular design and split the SDK files into their own target and then link to whatever target needs to use them? As of now it seems that I would need to include the SDK source code in my main application target.


The same issue happens with the following peripherals: eDMA, lpi2c, lpspi, lpuart, adc, and lin.

 

Thank you in advance and I hope someone can guide me to this puzzling issue. 

Adan

 

0 Kudos
Reply
0 Replies