2017-08-05 06:26 PM
F446/F429
Hi.
Im trying to get NVIC work but it's very confusing, i dont do HAL/SPL.
Are core_cm4.h all thats needed to setup and use NVIC?
I basically
need to get ADC1 to cause an interrupt so data can be processed.
I trying NVIC via SPL but i get weird compilation errors for things that
has nothing to do with NVIC and i would be glad not to be forced to use SPL.Thanks in advance for your time.
2017-08-06 06:21 AM
You still likely want to pull in stm32f4xx.h to define structures and register descriptions.
2017-08-06 12:17 PM
Well obvious, but i was thinking of something 'none obvious and specific' such as
SCB memory address is defined
in core_cm4.h which in a roundabout way is included by misc.c etc, etc,
in this world of ST abstractedness.Anyhow i got NVIC to work with only core_cm4.h, now some fine tuning work to do.
void nvic(void)
{/******************** NVIC configuration ***************************/NVIC_ClearPendingIRQ(ADC_IRQn); //Clear Pending InterruptNVIC_SetPriorityGrouping(1); //NVIC_SetPendingIRQ(ADC_IRQn); //Set Pending InterruptNVIC_SetPriority(ADC_IRQn,5); //ADC_IRQn have priority level of 5NVIC_EnableIRQ(ADC_IRQn); //Enable interrupt from ADC1,2,3}
2017-08-07 02:47 AM
Hello
pic24hj
,the same way as SCB block, you can use NVIC structure pointer and use interrupt implementation on your own. But it is suggested that you use code provided by ARM (NVIC and MISC) is part of this code.
There is also startup code where vectors are defined for functions.