Skip to content

Conversation

@ziliguo
Copy link

@ziliguo ziliguo commented Dec 26, 2025

  1. HW checksum for T-Put further optimization;
  2. Improve the download speed;
  3. adaption for "power start -l"
  4. Support of image encryption.

@ziliguo ziliguo changed the title os: Improve download speed, and adaption for new pm command Improve download speed, and adaption for new pm command about BK7239N Dec 26, 2025
@sunghan-chang
Copy link
Contributor

@ewoodev @hk-gwak @jylee9613 Could you review this?

@sunghan-chang
Copy link
Contributor

sunghan-chang commented Dec 26, 2025

@ziliguo Could you let us know details of 2. Improve the download speed;?
How did you improve and speed change from to ? With higher speed, we can get more noise. If it gets noise and data is corrupted, then how does downloader work? Is it possible to detect corruption? If it checks, and then?

@ziliguo
Copy link
Author

ziliguo commented Dec 26, 2025

@ziliguo Could you let us know details of 2. Improve the download speed;? How did you improve and speed change from to ? With higher speed, we can get more noise. If it gets noise and data is corrupted, then how does downloader work? Is it possible to detect corruption? If it checks, and then?

Hi @sunghan-chang ,
For the download speed improvement, we mainly modify the two points below, thus total download time improve from 26s to 15s.

  1. Improve UART download baudrate configuration(from 2M to 4M/6M): The baud rate configuration only needs to be changed in the beken download tool ( also named MP tool in the production line ) configuration;
  2. The high-speed serial port configuration in PC: This requires changing the serial port settings in the PC's Device Manager, changing the delay time from 16ms to 2ms.

For the noise issue with high-speed you have mentioned, we use flow below to keep stability:
By default, every 4K flash download, download flow:

  1. The beken download tool ( also named MP tool in the production line ) calc CRC1 for 4K data;
  2. Write to BK7239N by UART;
  3. Download tool send a cmd to get the CRC2 result, which BK7239N will calc after reading the 4K data from Flash;
  4. Download tool check CRC1=CRC2, if yes, go to next 4K bytes, else, try again.
    The download tool ensures that the content programmed into the Flash matches the original programming file.

required = ["kernel", "bootparam"]
optional = ["app1", "app2", "userfs"]
if self.config.get("CONFIG_BINARY_SIGNING", "n") != "y":
if self.config.get("CONFIG_TFM", "n") != "y":
Copy link
Contributor

Choose a reason for hiding this comment

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

@ziliguo : Please explain what is effect of this change ?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @amandeep-samsung ,
Before this modification was added, the bootloader was packaged within all-app.bin. After this modification, the bootloader can be separated from all-app.bin. This allows all-app.bin to be downloaded via the bootloader, and the bootloader includes optimizations for download speed.

@amandeep-samsung
Copy link
Contributor

amandeep-samsung commented Dec 26, 2025

@ziliguo Could you let us know details of 2. Improve the download speed;? How did you improve and speed change from to ? With higher speed, we can get more noise. If it gets noise and data is corrupted, then how does downloader work? Is it possible to detect corruption? If it checks, and then?

Hi @sunghan-chang , For the download speed improvement, we mainly modify the two points below, thus total download time improve from 26s to 15s.

  1. Improve UART download baudrate configuration(from 2M to 4M/6M): The baud rate configuration only needs to be changed in the beken download tool ( also named MP tool in the production line ) configuration;
  2. The high-speed serial port configuration in PC: This requires changing the serial port settings in the PC's Device Manager, changing the delay time from 16ms to 2ms.

For the noise issue with high-speed you have mentioned, we use flow below to keep stability: By default, every 4K flash download, download flow:

  1. The beken download tool ( also named MP tool in the production line ) calc CRC1 for 4K data;
  2. Write to BK7239N by UART;
  3. Download tool send a cmd to get the CRC2 result, which BK7239N will calc after reading the 4K data from Flash;
  4. Download tool check CRC1=CRC2, if yes, go to next 4K bytes, else, try again.
    The download tool ensures that the content programmed into the Flash matches the original programming file.

@ziliguo Latency Timer (msec) value is not changed in Realtek case, and we use same settings as 16 msec for it.
I have 2 questions for it.

  1. can Beken MP tool handle reading this responsive data faster by its own instead of changing Timer value ? Or
  2. tuning latency timer during download usage time only instead of changing driver level Latency Timer value for all time. ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for find this issue.

We'll fix this issue for master branch.
For now use power start -l -t.
And when master branch is updated, you can cherry-pick that code.

#7101

Copy link
Author

Choose a reason for hiding this comment

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

Hi @seokhun-eom24, got it. Once you update to the master branch, we will sync the PM changes to this BK7239N_Support branch. We will revert this commit for now. Thank you.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's merged now. you can revert this commit.

Copy link
Author

Choose a reason for hiding this comment

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

okay. It has already been reverted now.

return status;
}

int verify_firmware_signature(uint32_t address)
Copy link
Contributor

Choose a reason for hiding this comment

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

verify_firmware_signature seems verify only app binary signature.
How can we verify kernel binary? Would you please add up_verify_usersignature too?

Copy link
Author

Choose a reason for hiding this comment

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

Hello @jylee9613, during each startup, the bootloader verifies the signature of the kernel image, and only if the verification passes will it execute the kernel code; however, in the application code, the interface up_verify_kernelsignature has not been properly adapted yet. We will provide this interface in the future. Thank you.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that verify_firmware_signature is used only in internal. How about change this API to static?
We only use up_verify_usersignature/up_verify_kernelsignature.

Copy link
Author

@ziliguo ziliguo Dec 30, 2025

Choose a reason for hiding this comment

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

@jylee9613 Yes, of course. It has already been updated to static now.

@ziliguo
Copy link
Author

ziliguo commented Dec 29, 2025

@ziliguo Could you let us know details of 2. Improve the download speed;? How did you improve and speed change from to ? With higher speed, we can get more noise. If it gets noise and data is corrupted, then how does downloader work? Is it possible to detect corruption? If it checks, and then?

Hi @sunghan-chang , For the download speed improvement, we mainly modify the two points below, thus total download time improve from 26s to 15s.

  1. Improve UART download baudrate configuration(from 2M to 4M/6M): The baud rate configuration only needs to be changed in the beken download tool ( also named MP tool in the production line ) configuration;
  2. The high-speed serial port configuration in PC: This requires changing the serial port settings in the PC's Device Manager, changing the delay time from 16ms to 2ms.

For the noise issue with high-speed you have mentioned, we use flow below to keep stability: By default, every 4K flash download, download flow:

  1. The beken download tool ( also named MP tool in the production line ) calc CRC1 for 4K data;
  2. Write to BK7239N by UART;
  3. Download tool send a cmd to get the CRC2 result, which BK7239N will calc after reading the 4K data from Flash;
  4. Download tool check CRC1=CRC2, if yes, go to next 4K bytes, else, try again.
    The download tool ensures that the content programmed into the Flash matches the original programming file.

@ziliguo Latency Timer (msec) value is not changed in Realtek case, and we use same settings as 16 msec for it. I have 2 questions for it.

  1. can Beken MP tool handle reading this responsive data faster by its own instead of changing Timer value ? Or
  2. tuning latency timer during download usage time only instead of changing driver level Latency Timer value for all time. ?

@ziliguo Could you let us know details of 2. Improve the download speed;? How did you improve and speed change from to ? With higher speed, we can get more noise. If it gets noise and data is corrupted, then how does downloader work? Is it possible to detect corruption? If it checks, and then?

Hi @sunghan-chang , For the download speed improvement, we mainly modify the two points below, thus total download time improve from 26s to 15s.

  1. Improve UART download baudrate configuration(from 2M to 4M/6M): The baud rate configuration only needs to be changed in the beken download tool ( also named MP tool in the production line ) configuration;
  2. The high-speed serial port configuration in PC: This requires changing the serial port settings in the PC's Device Manager, changing the delay time from 16ms to 2ms.

For the noise issue with high-speed you have mentioned, we use flow below to keep stability: By default, every 4K flash download, download flow:

  1. The beken download tool ( also named MP tool in the production line ) calc CRC1 for 4K data;
  2. Write to BK7239N by UART;
  3. Download tool send a cmd to get the CRC2 result, which BK7239N will calc after reading the 4K data from Flash;
  4. Download tool check CRC1=CRC2, if yes, go to next 4K bytes, else, try again.
    The download tool ensures that the content programmed into the Flash matches the original programming file.

@ziliguo Latency Timer (msec) value is not changed in Realtek case, and we use same settings as 16 msec for it. I have 2 questions for it.

  1. can Beken MP tool handle reading this responsive data faster by its own instead of changing Timer value ? Or
  2. tuning latency timer during download usage time only instead of changing driver level Latency Timer value for all time. ?

Hi @amandeep-samsung , thank you for your valuable suggestion. The MP Tools team will consider this request and conduct a feasibility assessment.

- Move WiFi APIs to RAM, thus to improve more transfer performance;
- Allocate more flash partition size for kernel
- Before this modification was added, the bootloader was packaged within all-app.bin.
- After this modification, the bootloader can be separated from all-app.bin.
- This allows all-app.bin to be downloaded via the bootloader, and the bootloader includes optimizations for download speed.
…ature

- Adapt for pm test cmd
- Update the calculate_sha256 api about signature
- Fix the verify_firmware_signature api static issue
- Added BLE CoC SDK interface
- Supports dynamic parameter changes for multi-advertisement of BLE
- Update tfm and wifi libs
- Add hardware checksum port interface for lwIP.
- Introduce hardware checksum registration mechanism to allow vendors to register hardware checksum functions for improved performance.
  The system will use software checksum automatically when no hardware function is registered.
- Usage:
1. Enable CONFIG_NET_LWIP_HW_CHKSUM_PORT
2. Implement vendor-specific hardware checksum function with the following format:
   uint16_t vendor_chksum_func(const void *dataptr, int len)
3. Register the vendor function during initialization:
   lwip_register_hw_chksum(vendor_chksum_func)
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.

5 participants