CUBE MX和keil5调试问题记录

本文详细介绍了STM32F412RET6单片机中定时器7的工作原理,包括定时频率计算,以及串口通信问题的排查步骤,如线路检查、波特率匹配等。同时,文中提到了编译时出现的链接错误L6406E,涉及内存空间不足的问题及其解决方案。
摘要由CSDN通过智能技术生成

软件版本

定时器中断频率

芯片:STM32F412RET6

定时器为timer7,在APB1上,timer分频PSC=50(49+1),所以timer晶振为50MHz,timer7计数一次为1/1MHz = 1us但是不触发中断,又因为ARR为5000(4999+1),所以timer7计数5000次才进入定时器中断,即1us*5000 = 5ms一次timer7中断。

串口参数设置

芯片:STM32F412RET6

串口没调通或者乱码问题排查:

  1. 首先万用表看线与引脚是否导通。
  2. 引脚线是否短路、是否断路。
  3. 焊线没问题可用示波器接收Tx或者Rx波形图,查看波形图是否正确。
  4. 硬件及波形图没问题再看是否接错引脚,对照PCB图纸。
  5. 硬件和接线没问题再切换上下拉模式,GPIO Pull-up/Pull-down,有的Tx上拉,有的不上下拉(正点原子F429开发板)。
  6. 再看波特率会否匹配,窗口参数是否匹配,打开上位机串口调试助手调试。

编译提示L6406E: No space in execution regions with .ANY selector matching错误

linking...
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching df_to_cat021.o(.bss.RawDatatoCat021).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f412rx.o(STACK).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.bss.uart1_rx_buffer).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.bss.uart2_rec_buf).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching bd_serial_rx.o(.bss.BD_rx_buff).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching bd_serial_rx.o(.bss.BD_entire_frame).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f412rx.o(HEAP).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching raw_message_assemble.o(.bss.Msg_FIFO).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching bd_serial_rx.o(.bss..L_MergedGlobals).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.bss.hdma_usart1_rx).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.bss.hdma_usart2_rx).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching custom_timers.o(.bss.SYSTimer).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching libspace.o(.bss).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching spi.o(.bss.hspi1).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching spi.o(.bss.hspi4).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching i2c.o(.bss.hi2c2).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.bss.__stdout).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching tim.o(.bss.htim1).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching tim.o(.bss.htim6).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching tim.o(.bss.htim7).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching tim.o(.bss.htim8).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.bss.huart1).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.bss.huart2).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.bss.huart3).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.bss.huart6).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching raw_message_assemble.o(.bss..L_MergedGlobals).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching adsb_info_assemble.o(.bss.panel_info_instance).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching raw_message_assemble.o(.bss.RAW_AP_st_instance).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.data..L_MergedGlobals).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching stm32f4xx_hal.o(.data..L_MergedGlobals).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.ARM.use_no_argv).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching stm32f4xx_hal.o(.bss.uwTick).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching system_stm32f4xx.o(.data.SystemCoreClock).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6406E: No space in execution regions with .ANY selector matching adsb_maintask.o(.bss.adsb_main_global_val).
STM32F412RET_Pro\STM32F412RET_Pro.axf: Error: L6407E: Sections of aggregate size 0xc3954 bytes could not fit into .ANY selector(s).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值