When doing writes to flash(using ST Flash Lib) i.e. to update config variables, the OS will stall as there is a period of time where the Flash lib polls to ensure the operation was completed. This is just a while loop with a timeout of upto 0x2000 iterations.
These stalls can cause issues like buffer overflows on serial drivers etc......
So i was just wondering if anyone had come across this ?
Flash Write / CPU Stall Topic is solved
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Flash Write / CPU Stall
It should be fine but consider that interrupts are not being served, the impact has to be assessed for each IRQ source.
In the serial driver could cause some characters to be lost and you would get an overflow error on next interrupt. For SPI it would not matter much, you would get delayed notifications. For ADC streaming it would cause for missing callbacks but DMA would continue to fill buffers etc.
Giovanni
In the serial driver could cause some characters to be lost and you would get an overflow error on next interrupt. For SPI it would not matter much, you would get delayed notifications. For ADC streaming it would cause for missing callbacks but DMA would continue to fill buffers etc.
Giovanni
Re: Flash Write / CPU Stall
Giovanni wrote:It should be fine but consider that interrupts are not being served, the impact has to be assessed for each IRQ source.
In the serial driver could cause some characters to be lost and you would get an overflow error on next interrupt. For SPI it would not matter much, you would get delayed notifications. For ADC streaming it would cause for missing callbacks but DMA would continue to fill buffers etc.
Giovanni
The serial driver is the one that is causing issues, as the interrupts cant be served, basically i get buffer overrun, now this is not down to the SD queue, its down to the hardware uart overruning the buffer/shift reg, but the SD driver reports the same SD_OVERRUN_ERROR for for queue and uart buffer. I dont know why this is done like this, but it means you cant tell unless you dig down what the error is.
Might be worth having a different error for queue overrun ?
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Flash Write / CPU Stall
It is a good idea, it should definitely be a different error bit.
Giovanni
Giovanni
Re: Flash Write / CPU Stall
Giovanni wrote:It is a good idea, it should definitely be a different error bit.
Giovanni
how about
#define CHN_QUEUE_FULL (eventflags_t)32
or
#define CHN_QUEUE_OVERRUN (eventflags_t)32
This leaves SD_OVERRUN_ERROR as an hardware shift register error only ?
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times