You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Jan Clement <Ja...@cm-electronics.de> on 2018/06/18 08:04:38 UTC

nvic settings failing

Hello to you All,

I am new to mynewt and the ARM world as you would figure out by my 
question.. I have a strong background in the 8-bit world where problems 
tend to be easier..

I am working on a STM32f756 were I need to enable quite a lot of DMA 
streams and also other peripheral functions (i.e. usb) I can't find yet 
in mynewt code.

I really like the mynewt concept and would love to use it for my 
application, a multimedia device with a touch tft, eth and wlan module.

So my question is, would it be able for me to use the mynewt kernel for 
the running system (tasks, console, fs, update) but configure and access 
the devices and the interrupts without using the API?

I did this when i tried to configure DMA for use with ADC1, but when I 
write the NVIC register using HAL_NVIC_EnableIRQ(...) this crashes my 
code, printing an "Unhandled interrupt (72)" to the console. When I 
comment out the enable function, the system doesn't crash, but obviously 
DMA is not working either.

I have the corresponding IRQ function in my code:
	void DMA2_Stream0_IRQHandler(void)

but it never gets called, system crashes immediately after activating DMA.


Any pointer in the right direction is highly appreciated!

Thank you very much

jan



Re: nvic settings failing

Posted by Fabio Utzig <ut...@apache.org>.
Hi Jan,

We set all but a few IRQ handlers to "os_default_irq_asm" on initialization. What you have to do is to set your handler with:

NVIC_SetVector(DMA2_Stream0_IRQn, (uint32_t)DMA2_Stream0_IRQHandler);
NVIC_EnableVector(DMA2_Stream0_IRQn);

PS: No need to use the "HAL_" macros from STM32Cube for this...

Best,
Fabio

On Mon, Jun 18, 2018, at 5:04 AM, Jan Clement wrote:
> Hello to you All,
> 
> I am new to mynewt and the ARM world as you would figure out by my 
> question.. I have a strong background in the 8-bit world where problems 
> tend to be easier..
> 
> I am working on a STM32f756 were I need to enable quite a lot of DMA 
> streams and also other peripheral functions (i.e. usb) I can't find yet 
> in mynewt code.
> 
> I really like the mynewt concept and would love to use it for my 
> application, a multimedia device with a touch tft, eth and wlan module.
> 
> So my question is, would it be able for me to use the mynewt kernel for 
> the running system (tasks, console, fs, update) but configure and access 
> the devices and the interrupts without using the API?
> 
> I did this when i tried to configure DMA for use with ADC1, but when I 
> write the NVIC register using HAL_NVIC_EnableIRQ(...) this crashes my 
> code, printing an "Unhandled interrupt (72)" to the console. When I 
> comment out the enable function, the system doesn't crash, but obviously 
> DMA is not working either.
> 
> I have the corresponding IRQ function in my code:
> 	void DMA2_Stream0_IRQHandler(void)
> 
> but it never gets called, system crashes immediately after activating DMA.
> 
> 
> Any pointer in the right direction is highly appreciated!
> 
> Thank you very much
> 
> jan
> 
>