S32K的入门教学

本文摘要:本文章介绍如何使用NXP官方软件S32KDS,新建工程及基本开发使用

开发平台:S32 Design Studio for ARM Version 2.2

SDK版本:S32_SDK_S32K1xx_RTM_3.0.0

使用芯片:S32K148

一、新建工程
  1. 创建空工程
  1. 工程命名和芯片选型
  1. 选择SDK和调试器(无特殊需求其余默认)
  1. 选择芯片具体类型(pin数和封装会影响对应功能)
  1. 更新pin_mux(重选芯片类型后引脚矩阵会变化)
二、实现一个点灯程序
  1. 选择引脚
  1. 添加组件
  1. 生成代码
  1. 复制或拖拽必要代码
int main(void)
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  #ifdef PEX_RTOS_INIT
    PEX_RTOS_INIT();                   /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  /* For example: for(;;) { } */
    // 以下两句为时钟初始化,必须放在顶部,固定用法复制即可
    CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
    CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
    // 端口初始化 拖拽pin_mux组件下的函数进来
    PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

    while(1) {
        // 我们选择的PTC10 pin0-pin31对应0-31位
        PINS_DRV_TogglePins(PTC, 1 << 10UL);
        // ms延时函数 拖拽osif组件下的函数进来
        OSIF_TimeDelay(500);
    }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;) {
    if(exit_code != 0) {
      break;
    }
  }
  return exit_code;
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
三、常用的一些东西
  1. 放大缩小程序字体

放大:ctrl + shift + 加号

缩小:ctrl + 减号

  1. 生成bin或hex文件
  1. 找不到某些页面
  1. 烧录设置

Run:程序烧录后直接运行,不进入debug

Debug:程序烧录后进入debug,需要再点击debug中的run程序才运行

  1. 全局搜索内容

S32K148更多例程和源码以及最新内容下载地址:

nxp_s32k148_template: 使用NXP的S32KDS软件基于S32_SDK_S32K1xx_RTM_3.0.0编写的的S32K148各组件测试例程,亲测可用,带有注释,适用于S32K14X系列的芯片。 (gitee.com)

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阿衰0110

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值