Skip to content

Commit

Permalink
Added termination flag to device load for PIC1 bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Nov 22, 2024
1 parent efadc63 commit c69f5aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/vscp/common/vscp-bootdevice-pic1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ CBootDevice_PIC1::deviceInit(cguid& ourguid, uint8_t devicecode, bool bAbortOnFi

// There is data get message
if (VSCP_ERROR_SUCCESS != (rv = m_pclient->receive(rcvmsg))) {
spdlog::error("Failed to receive reponse form init command (ID_PUT_BASE_INFO). rv = {0}.", rv);
spdlog::error("Failed to receive response form init command (ID_PUT_BASE_INFO). rv = {0}.", rv);
if (nullptr != m_statusCallback) {
m_statusCallback(-1,
vscp_str_format("Failed to receive reponse form init command (ID_PUT_BASE_INFO). "
vscp_str_format("Failed to receive response form init command (ID_PUT_BASE_INFO). "
"rv = %d.",
rv)
.c_str());
Expand Down Expand Up @@ -653,7 +653,7 @@ CBootDevice_PIC1::checkResponseLevel1(uint32_t response_id)

spdlog::error("checkResponseLevel1: Timeout {}", rv);
if (nullptr != m_statusCallback) {
m_statusCallback(-1, "checkResponseLevel1: Timout waiting while for response");
m_statusCallback(-1, "checkResponseLevel1: Timeout waiting while for response");
}

return VSCP_ERROR_TIMEOUT;
Expand Down Expand Up @@ -699,7 +699,7 @@ CBootDevice_PIC1::checkResponseLevel2(uint32_t id)

spdlog::error("checkResponseLevel2: Timeout {}", rv);
if (nullptr != m_statusCallback) {
m_statusCallback(-1, "checkResponseLevel2: Timout waiting while for response");
m_statusCallback(-1, "checkResponseLevel2: Timeout waiting while for response");
}

return VSCP_ERROR_TIMEOUT;
Expand Down Expand Up @@ -877,7 +877,7 @@ CBootDevice_PIC1::writeFirmwareBlock(uint32_t start, uint32_t end)
//

int
CBootDevice_PIC1::deviceLoad(std::function<void(int, const char *)> statusCallback)
CBootDevice_PIC1::deviceLoad(std::function<void(int, const char *)> statusCallback, bool bAbortOnFirmwareCodeFail)
{
//bool bRun = true;
int rv;
Expand Down
14 changes: 7 additions & 7 deletions src/vscp/common/vscp-bootdevice-pic1.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Boston, MA 02111-1307, USA.
//
// For info see https://ww1.microchip.com/downloads/en/AppNotes/00247a.pdf
// this bootloader expects a slightly moified version of the bootloader
// this bootloader expects a slightly modified version of the bootloader
// described but in most aspects it is the same.
//
// Repository for the device bootloader is here
Expand All @@ -46,7 +46,7 @@ class CBootDevice_PIC1 : public CBootDevice {
This is Level I over Level I interface
@param pdll Pointer to opended CANAL object.
@param pdll Pointer to opened CANAL object.
@param nodeid Nickname/nodeid for node that should be loaded
with new code.
*/
Expand All @@ -61,7 +61,7 @@ class CBootDevice_PIC1 : public CBootDevice {
This is Level I over Level II that uses an interface on
a remote device to communicate with Level I nodes.
@param pdll Pointer to opended CANAL object.
@param pdll Pointer to opened CANAL object.
@param nodeid Nickname/nodeid for node that should be loaded
@param guidif GUID for interface.
with new code.
Expand Down Expand Up @@ -202,23 +202,23 @@ class CBootDevice_PIC1 : public CBootDevice {
and status message (const char *)
@return VSCP_ERROR_SUCCESS on success.
*/
int deviceLoad(std::function<void(int, const char *)> statusCallback = nullptr);
int deviceLoad(std::function<void(int, const char *)> statusCallback = nullptr, bool bAbortOnFirmwareCodeFail = false);

/*!
Restart remote device
@return VSCP_ERROR_SUCCESS is returned on success, ortherwise error code
@return VSCP_ERROR_SUCCESS is returned on success, otherwise error code
*/
int deviceRestart(void);

/*!
Reboot remote device
@return VSCP_ERROR_SUCCESS is returned on success, ortherwise error code
@return VSCP_ERROR_SUCCESS is returned on success, otherwise error code
*/
int deviceReboot(void);

/*!
Write a sector
@param paddr Pointer to firts byte of 8-byte block to write
@param paddr Pointer to first byte of 8-byte block to write
to remote device
@return VSCP_ERROR_SUCCESS on success.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/vscp/common/vscp-bootdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
An abstract memory model is used for the firmware. In this
model memory contents of different types is placed into
different memory regions. When a block of datra from that region
different memory regions. When a block of data from that region
is sent to the remote device it is up to that device to
place the data at the correct location. This model can be used
for code, ram, eeprom, fuses, config data etc. The pic1 bootloader
Expand Down

0 comments on commit c69f5aa

Please sign in to comment.