Is there a way to add a #include or external reference to "generated code" from Config tool?

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

Is there a way to add a #include or external reference to "generated code" from Config tool?

Jump to solution
1,294 Views
CktDesigner
Contributor IV

I'm attempting to use the MCUXpresso (v11.7.0) Config Tools to set up peripherals for my application.

I'm testing this on MIMXRT1060-EVKB using SDK v2.13.0

I'm attempting to use FlexIO2 with eDMA to parallel shift out an array of data.

Part of the DMA setup is to provide a "reference" address expression for both the Source (memory in my case) and a Destination (FlexIO shiftbuf in my case).

Question 1:

I'd like to use a variable name of the data array to be shifted out as the source address expression.   When the code is produced, this variable name is referenced in "peripherals.c" (as expected), but the compile fails due to the variable not being known.    Is there a way to add a "#include" or an "extern" declaration in the automatically generated code.   I want to avoid having to edit "peripherals.c" every time a change is made.

Question 2:

Are there "pre-defined" names for SHIFTBUFn registers (and other registers) that can be used as the destination/source address expression?

Question 3:

Are there any demos/examples/documentation on how to use the Config tool to create an application (other than the video that just creates a blinking LED)?   All of the SDK demos assume "manual" programming of all of the peripheral/setup registers.   The Config tool is great in that much of this is automated, but it is often confusing when referring to the demos for guidance, as it is unclear what the Config tool has done (versus not done).   This results in lots of time spent reading code (versus just using the Config tool) and effectively defeats the efficiency that the Config tool should provide.

 

Thanks!

 

0 Kudos
Reply
1 Solution
1,268 Views
Lukas_Heczko
NXP Employee
NXP Employee

Hello,

1. Regarding external declaration of addresses:

- In case you use DMA component in Peripherals tool, you can use the external definition settings:

Lukas_Heczko_0-1678885496470.png

- Alternatively, you can use general custom initialization component:

Lukas_Heczko_1-1678885542420.pngLukas_Heczko_2-1678885547659.png

2. Regarding SHIFTBUF register address:

- There is a dedicated FLEXIO_GetShifterBufferAddress() function in the FlexIO SDK driver (file fsl_flexio.c)

- For general purposes, you may use the register mapping in MIMXRT1062.h file to obtain the register address, e.g.: &(((DMA_Type *)DMA0_BASE)->CR)

3. Regarding Config Tools examples:

- You may try the MCUXpresso Config Tools Knowledge Base: https://community.nxp.com/t5/MCUXpresso-Config-Tools/tkb-p/mcuxpresso-config@tkb Otherwise, there is actually not much outside the MCUXpresso Config Tools User Guide: only few SDK examples uses the Peripherals tool (they can be found by looking for _peripheral suffix in their name), although they all use Pins and Clocks tool.

Regards,

Lukas

View solution in original post

3 Replies
1,269 Views
Lukas_Heczko
NXP Employee
NXP Employee

Hello,

1. Regarding external declaration of addresses:

- In case you use DMA component in Peripherals tool, you can use the external definition settings:

Lukas_Heczko_0-1678885496470.png

- Alternatively, you can use general custom initialization component:

Lukas_Heczko_1-1678885542420.pngLukas_Heczko_2-1678885547659.png

2. Regarding SHIFTBUF register address:

- There is a dedicated FLEXIO_GetShifterBufferAddress() function in the FlexIO SDK driver (file fsl_flexio.c)

- For general purposes, you may use the register mapping in MIMXRT1062.h file to obtain the register address, e.g.: &(((DMA_Type *)DMA0_BASE)->CR)

3. Regarding Config Tools examples:

- You may try the MCUXpresso Config Tools Knowledge Base: https://community.nxp.com/t5/MCUXpresso-Config-Tools/tkb-p/mcuxpresso-config@tkb Otherwise, there is actually not much outside the MCUXpresso Config Tools User Guide: only few SDK examples uses the Peripherals tool (they can be found by looking for _peripheral suffix in their name), although they all use Pins and Clocks tool.

Regards,

Lukas

1,261 Views
CktDesigner
Contributor IV

Thanks!

Very helpful!

Can I suggest that more examples/demos that use the Periph Config Tool be included (or more detailed documentation on the interaction between DMA and Peripherals be made available (in my case using DMA with FlexIO)!

Thanks again

0 Kudos
Reply
1,290 Views
ErichStyger
Specialist I

Hi @CktDesigner ,

not sure what you exactly need. But you can use the -include compiler option to include a header file in front of every compilation unit (file), so you can have there anything you like.

See https://mcuoneclipse.com/2019/02/23/different-ways-of-software-configuration/

Erich

0 Kudos
Reply