L6236E: No section matches selector - no section to be FIRST/LAST.

Keil打开xxxxxx.sct文件,如下图所示:

原因与处理
没有引入启动文件,将启动文件startup_stm32xxxxxx.s添加进工程中:
再在魔法棒Options of Target->Device,选择与启动文件相同的芯片型号。
在Options for Target >C/C++>Define中写下USE_HAL_DRIVER,STM32xxxxxx,与core下的启动文件一致。
注意:各型号与启动文件存在对应关系