PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.29k stars 13.43k forks source link

Support for logging via NAND flash #22490

Open j-chen-opteran opened 10 months ago

j-chen-opteran commented 10 months ago

Describe problem solved by the proposed feature

Describe your preferred solution

Describe possible alternatives

Ardupilot contains a driver that uses the NAND flash chip over SPI: https://github.com/ArduPilot/ardupilot/blob/c5b9f5051f997ec3f0f223380f912f5f51de641f/libraries/AP_Logger/AP_Logger_W25N01GV.cpp#L8 Something like this could be feasible.

Additional context

No response

julianoes commented 10 months ago

First step would be to add it to NuttX, I think.

Right @davids5?

davids5 commented 10 months ago

@j-chen-opteran have a look at https://lists.apache.org/thread/kh5t6fn24q97d3qxzthksld4l3jtw27c and see if this offers any indication it has been worked on, or added.

j-chen-opteran commented 10 months ago

Appreciate the quick replies! Did some digging in the direction @davids5 pointed. It appears NuttX itself has partial support for NAND flash and I'm happy to have a crack at implementing this.

However I see that PX4 submodules NuttX - this is a bit new to me and I'd like to start the right way. I assume code changes has to be done in the NuttX repo first?

Thanks

davids5 commented 10 months ago

@j-chen-opteran - the process can be done 2 ways, really in 2 differing orders.

1) Do the work in PX4's NuttX, backporting to your branch what you might need from upstream and then upstreaming your work to NuttX and then Backporting all the commits needed to add the feature.

2) Do the work in upstream and backport to PX4's NuttX then do your PX4 work on top of it.

In the end all the works should go upstream and get back ported.

iftahnaf commented 8 months ago

Hi @j-chen-opteran, are you working on this? I can try to help. I don't have a lot of experience in that field, but I'm eager to learn.

sstroobants commented 3 months ago

Is anyone working on this? If I understand correctly, V1.3 of the KakuteH7 mini even has 1GBit/128Mb of NAND Flash, would be a shame to let that go to waste.

julianoes commented 3 months ago

@sstroobants contributions welcome.

sstroobants commented 2 months ago

I would love to, but I'm afraid I lack the skills to develop something as embedded as this. If I find time I might try to see what is possible, but a first glance in the NuttX documentation makes me believe it has to be built from the ground up.

sstroobants commented 4 days ago

Again, I'd love for this to work and would want to spend some time on this. I do lack the skills to start on this however so if there is anyone that wants to help me with this, that'd be much appreciated.

dagar commented 4 days ago

@sstroobants it depends what actual hardware you're talking about, but potentially everything you need should be in place as of https://github.com/PX4/PX4-Autopilot/pull/23424.

sstroobants commented 3 days ago

@dagar thanks for the response. I am not exactly sure what you mean. The problem (I think), is support for NAND flash in NuttX and LittleFS which are both not (fully) implemented. Again, my knowledge on these low-level things is very limited so correct me if I'm wrong. From what I understand, there needs to be a driver for the W25N01GV and also support on NuttX side to do this nicely.