PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

[Bug] px4_mtd: n_partitions_current could be 0

Open w2016561536 opened this issue 1 year ago • 2 comments

Describe the bug

Hello, I am trying to port PX4 to a new board and found a problem in code.
In https://github.com/PX4/PX4-Autopilot/blob/c78389a855391adaf2dd05f58afcbc6b1500ff1a/platforms/nuttx/src/px4/common/px4_mtd.cpp#L203, the varible instance->n_partitions_current could be 0. And it triggers mcu divided by 0 assertion. Moreover, nblocks do not be used.

To Reproduce

N/A

Expected behavior

N/A

Screenshot / Media

No response

Flight Log

N/A

Software Version

N/A

Flight controller

N/A

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

w2016561536 avatar Feb 05 '24 06:02 w2016561536

Borrowing the building, may I ask why the drone can take off in altitude mode, but in self stabilization mode, the command is temporarily rejected

yuxuanwu1234567 avatar Feb 05 '24 09:02 yuxuanwu1234567

Borrowing the building, may I ask why the drone can take off in altitude mode, but in self stabilization mode, the command is temporarily rejected

Probably that your drone does not have a valid height sensor( baro, gps, lidar or others). BTW, please open an new issue if you have new question.

w2016561536 avatar Feb 05 '24 10:02 w2016561536