Microchip-MPLAB-Harmony / bootloader

Harmony 3 Bootloader
https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MH3_bootloader&redirect=true
Other
23 stars 13 forks source link

New sources support #3

Closed lucapascarella closed 3 years ago

lucapascarella commented 4 years ago

I was wondering if we can know when the support for other sources is available. I have a project to which I want to include a bootloader for a remote update but the bootloader should load the new firmware from an external SST flash memory. Do you have any roadmap when new boot sources are available? Thank Luca

dsettu commented 4 years ago

@lucapascarella , Can you provide more details on the use-case to plan for adding support. How are you sourcing the image and programming it in SST Flash?.

Do you intend to use File System to store the image in SST Flash or directly store the raw binary?.

lucapascarella commented 4 years ago

Currently, my business logic is that the app is in charge of contact the remote server, pull the binary image, copy into local SST flash, verify the MD5. When everything is ok, the app sets a flag and reboots enabling the bootloader. The bootloader reads the raw app and flashes it into PIC32. Actually, two images are downloaded one is the app and another is the MPFS for the web pages. The bootloader is in charge to perform both updates.

The SST is used for storing three raw images, the old and new web pages in MPFS format and the new app. It is divided into the fixed parts and the binary images are load at fixed addresses. I also evaluated to add the app into the MPFS image as a normal file to avoid two downloads but it is not efficient because the bootloader must decode the MPFS file system. I don't know, the solution with fixed addresses works for now.

I already did some steps by starting from the current bootloader with UART. In Harmony, I first create the bootloader and then added the SST driver.

dsettu commented 4 years ago

@lucapascarella , Thank you for your feedback, we will schedule to add support to Bootload from QSPI flash and it may be in 2H2020

youpko commented 4 years ago

I have a similar case as @lucapascarella where the update should pulled via the network to external flash memory and than flashed to the PIC32.

My project is also using a SST Flash memory but not in QSPI mode. I had to write a driver for the SST in SPI mode for the Harmony Filesystem, as one is not provided by Microchip yet.

I would like to see bootloader with Harmony Filesystem support. This would help in my current project but also open the possibility to update firmware form sources like SD-card.

cptkoolbeenz commented 4 years ago

Is/will there be a CDC or HID version in the works?

dsettu commented 4 years ago

I have a similar case as @lucapascarella where the update should pulled via the network to external flash memory and than flashed to the PIC32.

My project is also using a SST Flash memory but not in QSPI mode. I had to write a driver for the SST in SPI mode for the Harmony Filesystem, as one is not provided by Microchip yet.

I would like to see bootloader with Harmony Filesystem support. This would help in my current project but also open the possibility to update firmware form sources like SD-card.

@youpko , Thank you for your feedback. We will add Bootloader support for File system and also consider SPI mode support for SST Flash.

dsettu commented 4 years ago

Is/will there be a CDC or HID version in the works?

@langetacuna , It is in the plan to support in second half of 2020.

youpko commented 4 years ago

@dsettu That is nice to hear that file system support is planned. SPI support for the SST B series would be nice. My project uses the SST26VF064B-104I/SM because I couldn't use QSPI because a pin conflict with the MAC of the PIC32MZ

amitraddi commented 4 years ago

UDP, USB and SDCARD Bootloaders are now available as part of v3.4.0 release.

You can find the bootloader application in below repositiories https://github.com/Microchip-MPLAB-Harmony/bootloader_apps_ethernet https://github.com/Microchip-MPLAB-Harmony/bootloader_apps_usb https://github.com/Microchip-MPLAB-Harmony/bootloader_apps_sdcard

khlee11 commented 3 years ago

I am evaluating in PIC32MK mode. I applied UART BootLoader and proceeded normally until downloading the application and most of the functions work well. However, UART1 does not work. What is the problem? It is the same if you perform the initialization command again. BootLoader is defined as UART2 and it is executed as desired operation by resetting it. I don't know why only UART1 doesn't work. What's the problem?

amitraddi commented 3 years ago

@khlee11 Thank you for reporting. Can you please provide more information so that we can help on the issue you are facing

  1. Device Name
  2. MPLAB-X and XC32 version
  3. When you say UART1 is not working do you mean in the application or in bootloader?
khlee11 commented 3 years ago

@khlee11 Thank you for reporting. Can you please provide more information so that we can help on the issue you are facing

  1. Device Name: pic32mk_mcj_curiosity_pro EVB
    1. MPLAB-X and XC32 version: MPLAB-X v5.4, XC32 v2.5
    2. When you say UART1 is not working do you mean in the application or in bootloader? As in the example, the boot loader uses UART2. I added UART1 in the application code and tried to make it work. However, there was no communication. Using the LED, we entered the UART1_Write(void* buffer, const size_t size) function and checked the operation of writing data to'U1TXREG'. However, serial data is not being output from the port at all. UART2 used in boot loader operates normally. Even if the baud rate was changed, it operated without any problem accordingly.

Attach the code I tested Please help me. BTL_firmware.zip test_App_firmware.zip

amitraddi commented 3 years ago

@khlee11 I think i know what the issue is. There is a known issue with the PkoB4 firmware used by MPLAB-X v5.45 for PIC32MK MCJ device. Because of which you do not see any output on the UART1 channel. There are 2 solutions for this problem until next release of MPLAB-X

  1. You can use MPLAB-X v5.40 as the bootloader apps are tested with that for the current release OR
  2. You can install the old tool pack version (1.1.166) for MPLAB-X v5.45 and use that while programming the PIC32MKMCJ board as shown in below snapshot tools->packs->Tool Packs

image

Hope this helps

khlee11 commented 3 years ago

I'm sorry I did not understand the problem you described. I understood it to be a problem with the ToolPack version of PKoB4. But I don't think that's the problem.

It has the following configuration and the boot loader is downloaded. image

image

I have MPLAB 5.40 installed and use it. I wrote an application and defined UART1 there using Harmony3. It is defined as PinA4-Rx, PinB4-Tx. And when the app is running, it keeps sending data to UART1. However, there is no signal coming from the Tx pin. The operation of writing data to the'U1TXREG' register has been confirmed. I am not able to find out why the data written to the register is not being transmitted.

What is the problem? Am I writing the wrong code?

amitraddi commented 3 years ago

I'm sorry I did not understand the problem you described. I understood it to be a problem with the ToolPack version of PKoB4. But I don't think that's the problem.

It has the following configuration and the boot loader is downloaded. image

image

I have MPLAB 5.40 installed and use it. I wrote an application and defined UART1 there using Harmony3. It is defined as PinA4-Rx, PinB4-Tx. And when the app is running, it keeps sending data to UART1. However, there is no signal coming from the Tx pin. The operation of writing data to the'U1TXREG' register has been confirmed. I am not able to find out why the data written to the register is not being transmitted.

What is the problem? Am I writing the wrong code?

This issue is closed as part of https://github.com/Microchip-MPLAB-Harmony/bootloader/issues/7

amitraddi commented 3 years ago

Hi, Closing this issue as we have supported more sources (QSPI) as part of v3.5.0 release.