RAEM2点灯
很高兴收到了瑞萨电子RA生态工作是赠送的RA4M2-SENSOR开发板,RA4M2-SENSOR 是一款基于 RA4M2 系列微控制器的评估套件,支持 TrustZone 技术和片内安全加密引擎(SCE),提供硬件级安全保护,确保敏感数据安全。
它的特性如下:
- 内核:Arm® Cortex®-M33,频率高达 100MHz,支持 TrustZone
- 存储器:高达 512kB 的 Flash,128kB 的 SRAM
- 引脚:48-pin,LQFP 封装
- 温度:-40 °C 至 105 °C
- 电压范围:2.7 V 至 3.6 V
- 12 位 A/D 转换器、温度传感器,电容式触摸传感单元 (CTSU)
- CAN 2.0B,四线 SPI,独立 SPI/I2C 多主接口
- SCI(UART、简单 SPI、简单 I 2C),SDHI 和 MMC

板子上的资源如下:
1.三个用户指示灯(红色和黄色)
2.两个串口指示灯(红色)指示调试连接
- 两个电源指示灯(红色)
4.三个用户按键,一个复位按键
板子的真容如下:

原来以为板子挺大的,看介绍,没想到拿到手后发现这么的精巧!!!!
这次的RA生态工作室竟然赠送了一条Type C的USB电源线,非常值得好评!!!
插上USB电源

拿到板子,第一件事当然就是点灯了,直接进入主题!!!
1。打开RA smart 配置软件

2。新建工程RA4M2_LED

3.选择芯片

4。下一步

5。点击完成

打开原理图,可以知道

LED1对应P002
LED2对应P103
LED3对应P104
均为高电平点亮
6。进行LED配置


7.点击生成代码

打开KEIL

8。主函数点灯核心代码
#include "hal_data.h"
#include "LED.h"
#include "Systick.h"
FSP_CPP_HEADER
void R_BSP_WarmStart(bsp_warm_start_event_t event);
FSP_CPP_FOOTER
/*******************************************************************************************************************//**
-
main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used. This function
-
is called by main() when no RTOS is used.
*********************************************************************************************************************/
void hal_entry(void)
{
/ TODO: add your own code here */
hal_systick_init();
while(1)
{
LED1_ON();LED2_OFF();LED3_ON();
HAL_Delay(200);
LED1_OFF();LED2_ON();LED3_OFF();
HAL_Delay(200);
}
#if BSP_TZ_SECURE_BUILD
/* Enter non-secure code */
R_BSP_NonSecureEnter();
#endif
}
/*******************************************************************************************************************//**
-
This function is called at various points during the startup process. This implementation uses the event that is
-
called right before main() to set up the pins.
-
@param[in] event Where at in the start up process the code is currently at
**********************************************************************************************************************/
void R_BSP_WarmStart (bsp_warm_start_event_t event)
{
if (BSP_WARM_START_RESET == event)
{
#if BSP_FEATURE_FLASH_LP_VERSION != 0
R_FACI_LP->DFLCTL = 1U;
#endif
}
if (BSP_WARM_START_POST_C == event)
{
R_IOPORT_Open(&IOPORT_CFG_CTRL, &IOPORT_CFG_NAME);
#if BSP_CFG_SDRAM_ENABLED
R_BSP_SdramInit(true);
#endif
}
}
#if BSP_TZ_SECURE_BUILD
FSP_CPP_HEADER
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable ();
/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable ()
{
}
FSP_CPP_FOOTER
#endif

编译代码烧录板子


点灯效果查看视屏
RAEM2点灯
|