2017-03-04 07:13 AM
Ok so I am talking about the IRQ handlers for ADC, SPI, I2C USART etc..
I am expecting to see weak definitions of ADC_IRQHandler() function for example somewhere...but my startup_stm32.s file in startup directory does not know these functions...I am using the System Workbench for STM32.
I only see the following:
.weak NMI_Handler
.thumb_set NMI_Handler,Default_Handler.weak HardFault_Handler
.thumb_set HardFault_Handler,Default_Handler.weak MemManage_Handler
.thumb_set MemManage_Handler,Default_Handler.weak BusFault_Handler
.thumb_set BusFault_Handler,Default_Handler.weak UsageFault_Handler
.thumb_set UsageFault_Handler,Default_Handler.weak SVC_Handler
.thumb_set SVC_Handler,Default_Handler.weak DebugMon_Handler
.thumb_set DebugMon_Handler,Default_Handler.weak PendSV_Handler
.thumb_set PendSV_Handler,Default_Handler.weak SysTick_Handler
.thumb_set SysTick_Handler,Default_HandlerCan someone help?
2017-03-04 10:16 AM
The body code is typically in stm32fxyz_it.c and the table with weak definitions is in startup_stm32fxyz.s, or the linker script. The weak linkage is sufficient for unused vectors, you're expected to put handler code in your own .C files.
2017-03-05 10:01 PM
Ok first of all I am new to ST micro devices and the system workbench. However I am well familiar with Atmel microcontrollers and their ARM ranges. I am still struggling to find out more about these _IRQHandler functions...
I created a project in SystemWorkbench there is no stm32fxyz_it.c file I see the 'stm32f4xx_it.h' however under /inc directory.
Inside this header file there exists only the following function definitions:
void NMI_Handler(void);
void HardFault_Handler(void);void MemManage_Handler(void);void BusFault_Handler(void);void UsageFault_Handler(void);void SVC_Handler(void);void DebugMon_Handler(void);void PendSV_Handler(void);void SysTick_Handler(void);So where are the definitions (or even the weak ones) for example ADC_IRQHandler()?
As mentioned above they DO NOT exist in 'startup_stm32.s'. In this file also the 'g_pfnVectors' table shows as follows:
g_pfnVectors:
.word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word MemManage_Handler .word BusFault_Handler .word UsageFault_Handler .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word DebugMon_Handler .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 02017-03-06 06:29 AM
You'll observe you didn't specify a part in your original post, STM32 covers hundreds of different parts. The body code is frequently placed in stm32f4xx_it.c, but can be anywhere in your compiled code.
It would appear that you are using a generic startup_stm32.s rather than a part specific startup_stm32f401xx.c type file, and your vector table only contains the system handlers common to Cortex-M3/M4 parts. Check why your chosen tool chain does this, I'm not using it.
STM32F4xx_DSP_StdPeriph_Lib_V1.8.0\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\SW4STM32\startup_stm32f427_437xx.s
2017-03-06 11:13 AM
Hi
In all my CubeMX projects generated for 'System Workbench for STM32' the missing weak definitions can be found in
startup/startup_stm32xxxxx.s.
In Src/stm32l4xx_it.c and Inc/stm32l4xx_it.h only the used functions exists.
There must be something wrong with your setup.
How did you import the project to SW4STM32?
I use the generated directory as workspace, which contains the project folder. Then Import: General -> 'Existing Projects into Workspace' and poimt to the generated Dir above project folder. That is the default if you click on browse.
Dieter
2018-04-05 12:06 AM
I have a similar problem. My project also has the generic startup file. When I searched for the startup file startup_stm32f103x8 in the Firmware folder, it had the startup for every other controller in the series, (stm32f103x6, xb, xc, xg) but not my x8.
I have downloaded the firmware just yesterday but it still doesn't have provisions for my controller. I am thinking of hitting the STM32F103C8 board so had on the wall that it breaks into 103 pieces.
Damn you ST and AC6!!
When you have been shipping the C8 chips for some 10 years, why not take 10 minutes to make its startup file and include in the Firmware???