Comments (6)
I've been trying to track down the problem, but I'm kind of stumped. It appears that the breakdown is in the bool writeEEPROM(bool blink)
function, in this for
loop:
for (unsigned int tries = 3; tries; tries--)
{
mavlink_log_warning("Tries remaining: %d", tries);
FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
FLASH_ErasePage(FLASH_WRITE_ADDR);
status = FLASH_ErasePage(FLASH_WRITE_ADDR + FLASH_PAGE_SIZE);
for (unsigned int i = 0; i < sizeof(params_t) && status == FLASH_COMPLETE; i += 4)
status = FLASH_ProgramWord(FLASH_WRITE_ADDR + i, *(uint32_t *)((char *)&_params + i));
if (status == FLASH_COMPLETE)
break;
}
FLASH_Lock();
If the write works, it runs straight through as expected. When it doesn't work though, it goes through all 3 attempts but on the 3rd attempt seems to never exit from the inner for
loop. It doesn't freeze, because the autopilot keeps doing everything else, but it's as if it skips executing the rest of the function without actually returning. Very weird. Any thoughts @superjax or @gellings?
from rosflight_firmware.
That is really weird. I'll see if I can't work on it this weekend. I've been trying to get the asynchronous stuff working, and been running into issues myself. Perhaps it'll be good to work on something else for a minute.
from rosflight_firmware.
Was this solved?
from rosflight_firmware.
Nope. I've been trying to narrow down the commit where the bug was introduced, but haven't been able to yet. There doesn't seem to be a single commit where after that commit the issue always exists. It seems like instead it might happen in one commit, but not the next, but then comes back again a couple of commits later. So I haven't had any luck tracking it down yet, unfortunately
from rosflight_firmware.
One thing to try might be disabling all interrupts before we try to access the memory? Don't know if this would solve it, but it's possible that entering an interrupt routine messes with the EEPROM access somehow. It may also explain why it used to work then stopped, since we didn't use interrupts before then started using the IMU interrupt. Maybe? Just an ideal I had; I'll try it out as soon as I get a chance.
from rosflight_firmware.
This is fixed as of commit 2c879f8
from rosflight_firmware.
Related Issues (20)
- Binary built from source reports wrong version HOT 1
- Documentation parameter PARAM_ARM_STICKS doesn't exist HOT 2
- Add tests for re-arming after hardfault recovery
- Add documentation about hardfault recovery behavior.
- clang-format
- UBLOX receiver support
- RC_NUM_CHN - Switch to 8 channels by default
- Failed to open serial port HOT 7
- Support for servos HOT 4
- Arming from companion computer HOT 3
- Identity mixer for direct motor control HOT 1
- RC_LOST error persistent using SBUS HOT 3
- Hi everybody
- Can't fly the drone HOT 1
- Add Configrator HOT 2
- Set up auto-generated Docker workflow
- Scrub or replace MAVlink messages
- Update mixing system to be more flexible HOT 2
- Documentation for board.h
- Measure round-trip communication delay HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rosflight_firmware.