Hi mykepredkomimet
I attach definitely the project.
in the main.c All the freertos resources are created. The vAConsoleTask() has some lines of code to test the writing in the flash. These lines are not part of the application in itself are there for testing.
If the code is executed stepping with the debugger it works. If it is free to run the task will crash.
the console is called in this task as run_cmd();
If the bootloader is activated in the console the hex_is_download_active() will give true and the incoming bytes are read with the
if ( xQueueReceive( xQueueRx, &buf, ( TickType_t )40000 ) == pdPASS )
{
hex_get_data( buf );
}
The hex_get_data( ) will process each byte from the hex file, until the writing in flash. All the infrastructure is working correctly in another bootloader without the ROTS.
It is several years now the bootloader is running with this solution. I do not read any problem in deleting all the flash and writing in chuncks of arbitrary ( but limited by the buffer ram ) length. The only limitation is not to write two times to the same address, not cumulative writes are admitted in Kinetis.
The linkker script is tailored for the TWR100 kit, with the TWR SER board
If You can test just connect the USB as a com with the bit rate You want.
from the console type DLOAD APP .
This will delete all the APP AREA flash and will begin to liste all of the bytes. From TeraTerm drop or send the HEX file and the bootload begins.
I remark all of this is already working so I trust the console. I am quite sure the problem is the compliance with the RTOS.
I am extremely grateful for your interest and help.
Be blessed.
Thank You
Pietro