My first project got stuck on interrupt handling.
This was a project created from the atmel start GUI tool.
My second project was created from the atmega4809 demo.
It was working fine, I got multiple tasks, queues, notifications end timers running without a problem.
Then I copied the I2C_master.c file from the first project.
This was auto generated component by atmel start.
I2C_master.c started to ask for several dependencies.
driver.h, driver_isr.c, compiler.h etc.
Most of them where placed inside util folder, so i also copied all the other dependencies over.
FreeRTOS complained about atomic.h which is part of FreeRTOS but I also copied it over from the other project.
After a while I managed it to compile without errors, got some implicit warnings though
In the end a atmel start project without freertos can run the I2C without a problem.
But a project with FreeRTOS not:
I2C_0_read2ByteRegister(0x4CU, 0);
I put above in een while loop, and it gets stuck, it keeps the I2C bus busy and never triggers the following interrupt:
ISR(TWI0_TWIM_vect)
{
I2C_0_master_isr();
}
During implementation I’ve seen warning like __VECTOR(15) converted to int
But also ISR(TWI0_TWIM_vect) is returning non-void
There is something weird going on in the handling of interrupt vectors as soon as freetos gets in touch with components from atmel start project.