Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ping360 firmware update functionality #1070

Open
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

jaxxzer
Copy link
Member

@jaxxzer jaxxzer commented Dec 19, 2023

Add firmware update functionality for Ping360.

This is based on top of #1069

The bootloader will wait for communication for 2s after powering on before it automatically starts the main application firmware. If the bootloader receives a valid packet, then it will not automatically start the main application.

If the device is stuck in the bootloader (failed programming), the protocol detector and device manager will still identify the device as a ping360 and let you select it. Then there will be a message over the polarplot telling you the device is stuck in the bootloader and asking you to update the firmware.

If the device with valid firmware is plugged in while the protocol detector/device manager is running, then the detector may see the bootloader before the firmware is automatically started. The detector will ask the bootloader to start the main application firmware and all proceeds as normal.

Copy link
Member

@patrickelectric patrickelectric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments


void Ping360FlashWorker::run()
{
float flashProgressPercentFactor = _verify ? 33.3f : 50.0f;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some explanation about this numbers ?

_port = new QSerialPort();
QSerialPortInfo pInfo(_link.serialPort());
_port->setPort(pInfo);
_port->setBaudRate(115200);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that supposed to be configured ? Since flasher now has validBaudRates

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, there is only one valid baudrate, but yes ✔️

}

if (!_port->isOpen()) {
error("error opening port");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we supposed to return here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. ✔️

@jaxxzer jaxxzer force-pushed the p360flash-5 branch 3 times, most recently from d94d4dd to 9a0a885 Compare January 29, 2024 20:19
@jaxxzer jaxxzer force-pushed the p360flash-5 branch 5 times, most recently from d96fc16 to 68fa8b4 Compare February 1, 2024 23:01
@jaxxzer jaxxzer force-pushed the p360flash-5 branch 6 times, most recently from 7d49504 to 68fa8b4 Compare March 6, 2024 16:43
the protocol detector functionality is not necessary or used during
mannual connection. In fact, the protocol detector scan may interfere
with sensor (ping360 bootloader) communication or operation by writing extraneous/
unexpected data. When selecting manual connection, the sensor may be connected without
writing unnecessary bytes.
- send requensts when sensor settings struct is valid,
  this allows adjusting/updating the sensor settings during async scan
- reset baudrate to avoid collisions during async profile message transmission
- start profile timeout timer to ensure new profile request is received
…han once

this allows the logic type to be updated after a firmware update
This is a parameter needed for auto transmit strategy
fw 3.1.1 will get hung up otherwise and not respond to timeout profile requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants