Need Clarification of 2.3.1 SDK Examples and MCUXpresso Config

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Need Clarification of 2.3.1 SDK Examples and MCUXpresso Config

661 次查看
Keith4DSmith
Contributor V

Using MCUXpresso IDE, I have cloned a few 2.3.1 SDK examples for the FRDM-K22F eval board.

I then created the <peripheral, clock_config, pin_mux>.<c,h> files using MCUXpresso Config for the FRDM-K22F eval board.

The SDK pin_mux.c file has YAML comments, as do the files generated by MCUXpresso Config.

However, the SDK pin_mux.c file seems to be an example minimal version of the Config pin_mux.c.

The SDK files board.<c,h> are the equivalent to peripheral.<c,h> in Config.

main() in an SDK example calls

BOARD_InitPins();
BOARD_BootClockHSRUN();
BOARD_InitDebugConsole();

Using the Config files it appears that main() should call

BOARD_InitBootPins();

BOARD_BootClockHSRUN();

BOARD_InitBootPeripherals();   // BOARD_InitDEBUG_UARTPeripheral() called.

My goal is to be able to configure all the peripherals I need for a target K22 project. The SDK examples configure only one peripheral per example. My project will need to have multiple peripherals, ADC, GPIO, etc. configured at boot.

I believe I could substitute the files from Config for the board/pin_mux/clock_config files in the SDK and call the appropriate functions in main().

Is this an expected method to customize an SDK example?

2 回复数

427 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Keith:

Yes, you can substitute the files from Config for the board/pin_mux/clock_config files in the SDK and call the appropriate functions in main().

Please also refer to the doc: Getting Started with MCUXpresso SDK.

Regards

Daniel

0 项奖励

427 次查看
lucasrangit
Contributor III

The SDK files board.<c,h> are the equivalent to peripheral.<c,h> in Config.

I'm confused why the MCUXpresso Config Tool creates a peripherals.c/.h file when the board.c/.h file from the examples contain similar code. Was board.c the old location for the peripheral generated code? I don't see the Config Tool touching it anymore. Is the new location peripherals.c suppose to replace board.c? If so, what should board.c be used for, if at all?

0 项奖励