![]() ![]() Volatile : tells the compiler not to assume anything about optimizing the generated instructions for the reads/writes of this variable. I will try to explain each thing in turn, and not make it too complicated, but the subject can become complicated I'm afraid. I will leave it to you to decide to open a new topic or not. It's possible that the problem is due to the behaviour reported in this topic but it does not feel like it to me I could be wrong though. ![]() PulsosEDs.reg] = 0 ĪuxPtr.numRegs] = 0 ĬarregaArquivos.write((const uint8_t *)auxPtr, ((sizeof(uint32_t) * readings.numRegs) + 1)) Uint32_tBuffer = (uint32_t *)malloc(((readings.numRegs * sizeof(uint32_t)) + 1)) I will paste here the passages involved in this error, where I use the variable, maybe it will facilitate the understanding.ĪttachInterrupt(digitalPinToInterrupt(pin), interrupcaoED1, FALLING) Įxtern volatile bool entradasDigitais I put it here because I thought about solving it by reading the interrupt flag and incrementing myself the variable, without ISR. Is it for me to leave the variable incrementing, but not to use it anywhere to make a test if the problem appears? I did not take this test! Good idea, I'll code and send it to my colleagues to test it. When you say: "Also, is it aligned on the correct boundary memory, and if it's commenting on the access to the variable in just the main code (or the idr) does the wdt reset go away?" This part I did not understand, can you explain me better? "It also has to be 'atomic' which means to read / write to a variable with a bit size smaller or same as the architecture which in this case is 32 bit." I tested it with 'volatile' but it did not change anything. Within the interruption, a variable is incremented. I thought about doing a brief program to explain the problem, but I will not be able to provoke the problem here, since I am traveling (away from the company).īut it's really really simple stuff that I do and I do not understand why the problem happens. Something is happening with my account and I do not receive replies by email. Yes, a simple example replicating the problem is always a good start - it is something us 'professionals' will do when other methods of fault detection fail. Also, is it aligned on the correct memory boundary, and if yu comment out the access to the variable in just the main code (or the idr) does the wdt reset go away? Is the variable you are changing in the isr a simple data type (int etc) and is it marked as 'volatile' in the global declaration of it? It also has to be 'atomic' which means a read/write to a variable with a bit size smaller or same as the architecture which in this case is 32 bit. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |