You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2024/03/20 09:42:36 UTC
(mynewt-core) branch master updated (4bba3b752 -> c9b0ded84)
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
from 4bba3b752 tinusb: Fix usbd_stack memory alignment
new f69c24c79 mcu/pic32: Add image_header region
new c9b0ded84 mcu/pic32: Add minimal boot code
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
hw/mcu/microchip/pic32mz/p32mz_app.ld | 5 +++++
hw/mcu/microchip/pic32mz/pkg.yml | 1 +
kernel/os/src/arch/pic32/startup/crt0.S | 19 +++++++++++++++++++
3 files changed, 25 insertions(+)
(mynewt-core) 01/02: mcu/pic32: Add image_header region
Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit f69c24c79e2e1009b94b2f485537bc38851a1b7f
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Sat Mar 16 18:39:22 2024 +0100
mcu/pic32: Add image_header region
This add dependency to mgmt/image_header package
that provides dummy image header so elf file can
be loaded to device without creating the image with newt tool.
This image header is then replaced by newt tool.
---
hw/mcu/microchip/pic32mz/p32mz_app.ld | 5 +++++
hw/mcu/microchip/pic32mz/pkg.yml | 1 +
2 files changed, 6 insertions(+)
diff --git a/hw/mcu/microchip/pic32mz/p32mz_app.ld b/hw/mcu/microchip/pic32mz/p32mz_app.ld
index 0af636b86..3310fc7bc 100644
--- a/hw/mcu/microchip/pic32mz/p32mz_app.ld
+++ b/hw/mcu/microchip/pic32mz/p32mz_app.ld
@@ -117,6 +117,7 @@ MEMORY
{
kseg1_boot_mem : ORIGIN = 0x9FC00000, LENGTH = 0x480
kseg1_boot_mem_4B0 : ORIGIN = 0xBFC004B0, LENGTH = 0xA50
+ kseg0_image_header_mem (r) : ORIGIN = 0x9D000000, LENGTH = 0x20
INCLUDE p32mz_app_mem.ld
config_BFC0FF40 : ORIGIN = 0xBFC0FF40, LENGTH = 0x4
config_BFC0FF44 : ORIGIN = 0xBFC0FF44, LENGTH = 0x4
@@ -695,6 +696,10 @@ SECTIONS
KEEP(*(.boot_reset))
} > kseg1_boot_mem
/* Boot Sections */
+ .image_header :
+ {
+ KEEP(*(.image_header*)) /* Image header */
+ } > kseg0_image_header_mem
.reset :
{
_app_reset = .;
diff --git a/hw/mcu/microchip/pic32mz/pkg.yml b/hw/mcu/microchip/pic32mz/pkg.yml
index 38874b8d9..0096c9050 100644
--- a/hw/mcu/microchip/pic32mz/pkg.yml
+++ b/hw/mcu/microchip/pic32mz/pkg.yml
@@ -28,6 +28,7 @@ pkg.keywords:
pkg.deps:
- "@apache-mynewt-core/hw/hal"
- "@apache-mynewt-core/hw/drivers/uart/uart_hal"
+ - "@apache-mynewt-core/mgmt/image_header"
pkg.deps.ETH_0:
- "@apache-mynewt-core/hw/drivers/lwip/pic32_eth"
(mynewt-core) 02/02: mcu/pic32: Add minimal boot code
Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit c9b0ded843a3a21680d0bf802689f2d92b53090e
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Sat Mar 16 18:45:22 2024 +0100
mcu/pic32: Add minimal boot code
There is special flash area dedicated to bootloader (0xbfc00000-0xbfc0FF00).
Code from this area is execute first.
This is where mcuboot is placed.
It is possible to build application elf that provides minimal
code that jumps to normal flash area dedicated for applications.
The elf generated this way can then easyly be used in MPLAB X ide
instead of command line gdb.
When syscfg has MCU_NO_BOOTLOADER_BUILD set to 1
additional section is generated that goes to bootloader area of MCU.
---
kernel/os/src/arch/pic32/startup/crt0.S | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/kernel/os/src/arch/pic32/startup/crt0.S b/kernel/os/src/arch/pic32/startup/crt0.S
index ac30225ab..16634271d 100644
--- a/kernel/os/src/arch/pic32/startup/crt0.S
+++ b/kernel/os/src/arch/pic32/startup/crt0.S
@@ -633,6 +633,25 @@ __crt0_exit:
.globl __crt0_exit
.end _main_entry
+#if MYNEWT_VAL_MCU_NO_BOOTLOADER_BUILD
+ ##################################################################
+ # This is startup code for no boot loader application.
+ # This jumps from boot flash to program flash.
+ # It is not used for bootload/application build since it would
+ # generate huge image.
+ ##################################################################
+ .section .boot_reset,code
+ .align 2
+ .set reorder
+ .ent _boot_reset
+_boot_reset:
+ la v0, _app_reset
+ jr v0
+
+ .align 2
+ .end _boot_reset
+#endif
+
.section .text.SystemInit,code
.align 2
.weak SystemInit