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 2023/09/25 09:47:45 UTC
[mynewt-core] branch master updated (d69562442 -> 8a8077215)
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 d69562442 lvgl: Add logging settings to syscfg
new 0adba9d68 baselibc: Call mynewt_main() instead of main()
new 63f7f9827 baselibc: Replace main with mynewt_main
new 8a8077215 Provide mynewt_main in linker scripts
The 3 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:
apps/bleprph_oic/src/main.c | 2 +-
apps/blesplit/src/main.c | 2 +-
apps/bleuart/src/main.c | 2 +-
apps/bsncent/src/main.c | 2 +-
apps/bsnprph/src/main.c | 2 +-
apps/bus_test/src/main.c | 2 +-
apps/buzzer/src/main.c | 2 +-
apps/coremark/src/core_main.c | 6 +-
apps/crypto_test/src/main.c | 2 +-
apps/ffs2native/src/main.c | 2 +-
apps/flash_loader/src/fl.c | 2 +-
apps/fs_test/src/main.c | 6 +-
apps/hash_test/src/main.c | 2 +-
apps/iptest/src/main.c | 6 +-
apps/lora_app_shell/src/main.c | 6 +-
apps/loraping/src/main.c | 6 +-
apps/lorashell/src/main.c | 6 +-
apps/metrics/src/main.c | 2 +-
apps/ocf_sample/src/main.c | 6 +-
apps/osdp_sample/src/main.c | 2 +-
apps/pwm_test/src/main.c | 2 +-
apps/sensors_test/src/main.c | 6 +-
apps/slinky/src/main.c | 6 +-
apps/slinky_oic/src/main.c | 6 +-
apps/spitest/src/main.c | 6 +-
apps/splitty/src/main.c | 6 +-
apps/testbench/src/testbench.c | 2 +-
apps/timtest/src/main.c | 2 +-
apps/trng_test/src/main.c | 2 +-
boot/split_app/src/split_app.c | 6 +-
hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld | 1 +
hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld | 1 +
hw/bsp/hifive1/hifive1.ld | 1 +
hw/bsp/native/src/hal_bsp.c | 8 ++
hw/bsp/usbmkw41z/boot-mkw41z512.ld | 1 +
hw/bsp/usbmkw41z/mkw41z512.ld | 1 +
hw/bsp/usbmkw41z/no-boot-mkw41z512.ld | 1 +
hw/mcu/ambiq/apollo2/apollo2.ld | 1 +
hw/mcu/ambiq/apollo3/apollo3.ld | 3 +-
hw/mcu/dialog/da1469x/da1469x.ld | 1 +
hw/mcu/dialog/da1469x/da1469x_ram_resident.ld | 1 +
hw/mcu/native/src/hal_system.c | 4 +-
hw/mcu/nordic/nrf51xxx/nrf51.ld | 1 +
hw/mcu/nordic/nrf52xxx/nrf52.ld | 1 +
hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld | 1 +
hw/mcu/nordic/nrf5340/nrf5340.ld | 1 +
hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld | 1 +
hw/mcu/nordic/nrf5340_net/nrf5340_net.ld | 1 +
.../nordic/nrf5340_net/nrf5340_net_ram_resident.ld | 1 +
hw/mcu/nordic/nrf91xx/nrf91.ld | 1 +
hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld | 1 +
hw/mcu/stm/stm32f0xx/stm32f0xx.ld | 1 +
hw/mcu/stm/stm32f1xx/stm32f103.ld | 1 +
hw/mcu/stm/stm32f3xx/stm32f303.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f401.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f407.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f411.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f413.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f427.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f429.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f439.ld | 1 +
hw/mcu/stm/stm32f7xx/stm32f746.ld | 1 +
hw/mcu/stm/stm32f7xx/stm32f767.ld | 1 +
hw/mcu/stm/stm32h7xx/stm32h723.ld | 1 +
hw/mcu/stm/stm32l0xx/stm32l072.ld | 1 +
hw/mcu/stm/stm32l0xx/stm32l073.ld | 1 +
hw/mcu/stm/stm32l1xx/stm32l152.ld | 1 +
hw/mcu/stm/stm32l4xx/stm32l476.ld | 1 +
hw/mcu/stm/stm32u5xx/stm32u5xx.ld | 1 +
hw/mcu/stm/stm32wbxx/stm32wb55.ld | 116 +++++++++++----------
libc/baselibc/pkg.yml | 1 +
libc/baselibc/src/start.c | 6 +-
net/ip/lwip_base/test/fuzz/fuzz.c | 3 +-
73 files changed, 148 insertions(+), 141 deletions(-)
[mynewt-core] 02/03: baselibc: Replace main with mynewt_main
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 63f7f98271115912bb8d5ab5f764dfc7e021443e
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Sun Jun 11 15:17:44 2023 +0200
baselibc: Replace main with mynewt_main
---
apps/coremark/src/core_main.c | 6 +-----
apps/flash_loader/src/fl.c | 2 +-
apps/fs_test/src/main.c | 4 ----
apps/iptest/src/main.c | 4 ----
apps/lora_app_shell/src/main.c | 4 ----
apps/loraping/src/main.c | 4 ----
apps/lorashell/src/main.c | 4 ----
apps/ocf_sample/src/main.c | 4 ----
apps/sensors_test/src/main.c | 4 ----
apps/slinky/src/main.c | 4 ----
apps/slinky_oic/src/main.c | 4 ----
apps/spitest/src/main.c | 4 ----
apps/splitty/src/main.c | 4 ----
apps/testbench/src/testbench.c | 2 +-
boot/split_app/src/split_app.c | 6 +++---
hw/bsp/native/src/hal_bsp.c | 8 ++++++++
hw/mcu/native/src/hal_system.c | 4 ++--
net/ip/lwip_base/test/fuzz/fuzz.c | 3 ++-
18 files changed, 18 insertions(+), 57 deletions(-)
diff --git a/apps/coremark/src/core_main.c b/apps/coremark/src/core_main.c
index 96d7249d9..e7c189880 100644
--- a/apps/coremark/src/core_main.c
+++ b/apps/coremark/src/core_main.c
@@ -354,12 +354,8 @@ MAIN_RETURN_TYPE coremark_main(int argc, char *argv[]) {
}
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
coremark_main(argc, argv);
diff --git a/apps/flash_loader/src/fl.c b/apps/flash_loader/src/fl.c
index 5cdb7cba5..d69db18b3 100644
--- a/apps/flash_loader/src/fl.c
+++ b/apps/flash_loader/src/fl.c
@@ -166,7 +166,7 @@ blink_led(void)
}
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/fs_test/src/main.c b/apps/fs_test/src/main.c
index 5d5a8288d..cab5db3fa 100644
--- a/apps/fs_test/src/main.c
+++ b/apps/fs_test/src/main.c
@@ -435,10 +435,6 @@ init_tasks(void)
int
mynewt_main(int argc, char **argv)
{
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
init_tasks();
diff --git a/apps/iptest/src/main.c b/apps/iptest/src/main.c
index 9d940b301..9553eff26 100644
--- a/apps/iptest/src/main.c
+++ b/apps/iptest/src/main.c
@@ -416,10 +416,6 @@ omgr_app_init(void)
int
mynewt_main(int argc, char **argv)
{
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
console_printf("iptest\n");
diff --git a/apps/lora_app_shell/src/main.c b/apps/lora_app_shell/src/main.c
index 8759fc87e..e0c4ed2a1 100644
--- a/apps/lora_app_shell/src/main.c
+++ b/apps/lora_app_shell/src/main.c
@@ -137,10 +137,6 @@ static const oc_handler_t omgr_oc_handler = {
int
mynewt_main(int argc, char **argv)
{
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
console_printf("\n");
diff --git a/apps/loraping/src/main.c b/apps/loraping/src/main.c
index 1cb91fbdb..13c3f5724 100644
--- a/apps/loraping/src/main.c
+++ b/apps/loraping/src/main.c
@@ -217,10 +217,6 @@ mynewt_main(int argc, char **argv)
{
RadioEvents_t radio_events;
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
/* Radio initialization. */
diff --git a/apps/lorashell/src/main.c b/apps/lorashell/src/main.c
index 283fc9165..c03c42b26 100644
--- a/apps/lorashell/src/main.c
+++ b/apps/lorashell/src/main.c
@@ -476,10 +476,6 @@ mynewt_main(int argc, char **argv)
int rc;
int i;
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
for (i = 0; i < LORASHELL_NUM_CLI_CMDS; i++) {
diff --git a/apps/ocf_sample/src/main.c b/apps/ocf_sample/src/main.c
index e120de19d..166ec6e97 100644
--- a/apps/ocf_sample/src/main.c
+++ b/apps/ocf_sample/src/main.c
@@ -242,10 +242,6 @@ ocf_init_tasks(void)
int
mynewt_main(int argc, char **argv)
{
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
/* Initialize OS */
sysinit();
diff --git a/apps/sensors_test/src/main.c b/apps/sensors_test/src/main.c
index 89843dea2..0f965ab69 100644
--- a/apps/sensors_test/src/main.c
+++ b/apps/sensors_test/src/main.c
@@ -451,10 +451,6 @@ sensor_ble_oic_server_init(void)
int
mynewt_main(int argc, char **argv)
{
-
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
/* Initialize OS */
sysinit();
diff --git a/apps/slinky/src/main.c b/apps/slinky/src/main.c
index d95b166c9..f9083d760 100644
--- a/apps/slinky/src/main.c
+++ b/apps/slinky/src/main.c
@@ -219,10 +219,6 @@ mynewt_main(int argc, char **argv)
{
int rc;
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
rc = conf_register(&test_conf_handler);
diff --git a/apps/slinky_oic/src/main.c b/apps/slinky_oic/src/main.c
index 4a41a2619..e2f54a8ab 100644
--- a/apps/slinky_oic/src/main.c
+++ b/apps/slinky_oic/src/main.c
@@ -256,10 +256,6 @@ mynewt_main(int argc, char **argv)
{
int rc;
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
rc = conf_register(&test_conf_handler);
diff --git a/apps/spitest/src/main.c b/apps/spitest/src/main.c
index 4b600dcde..8f5b45d83 100644
--- a/apps/spitest/src/main.c
+++ b/apps/spitest/src/main.c
@@ -430,10 +430,6 @@ mynewt_main(int argc, char **argv)
{
int rc;
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
init_tasks();
diff --git a/apps/splitty/src/main.c b/apps/splitty/src/main.c
index d1a897556..7cc2e5ec7 100644
--- a/apps/splitty/src/main.c
+++ b/apps/splitty/src/main.c
@@ -178,10 +178,6 @@ mynewt_main(int argc, char **argv)
{
int rc;
-#ifdef ARCH_sim
- mcu_sim_parse_args(argc, argv);
-#endif
-
sysinit();
cbmem_init(&cbmem, cbmem_buf, MAX_CBMEM_BUF);
diff --git a/apps/testbench/src/testbench.c b/apps/testbench/src/testbench.c
index e10eefe9b..6d8a1fdf7 100644
--- a/apps/testbench/src/testbench.c
+++ b/apps/testbench/src/testbench.c
@@ -121,7 +121,7 @@ static const oc_handler_t omgr_oc_handler = {
* Complexity is pushed down to the individual test suites and component test cases.
*/
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/boot/split_app/src/split_app.c b/boot/split_app/src/split_app.c
index 04f89c128..6d2095593 100644
--- a/boot/split_app/src/split_app.c
+++ b/boot/split_app/src/split_app.c
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include "os/mynewt.h"
-extern int main(int argc, char **argv);
+extern int mynewt_main(int argc, char **argv);
/**
* Rudimentary startup function. Only called in the "application" half of a
@@ -44,10 +44,10 @@ _start_split(void)
#if !MYNEWT_VAL(OS_SCHEDULING)
int rc;
- rc = main(0, NULL);
+ rc = mynewt_main(0, NULL);
exit(rc);
#else
- os_init(main);
+ os_init(mynewt_main);
os_start();
#endif
}
diff --git a/hw/bsp/native/src/hal_bsp.c b/hw/bsp/native/src/hal_bsp.c
index dafc44fc8..2c89787ca 100644
--- a/hw/bsp/native/src/hal_bsp.c
+++ b/hw/bsp/native/src/hal_bsp.c
@@ -140,3 +140,11 @@ hal_bsp_init_trng(void)
assert(rc == 0);
}
}
+
+#if !MYNEWT_VAL(SELFTEST)
+int
+main(int argc, char **argv)
+{
+ mcu_sim_parse_args(argc, argv);
+}
+#endif
diff --git a/hw/mcu/native/src/hal_system.c b/hw/mcu/native/src/hal_system.c
index 5ccac9c94..a060a806f 100644
--- a/hw/mcu/native/src/hal_system.c
+++ b/hw/mcu/native/src/hal_system.c
@@ -88,7 +88,7 @@ mcu_sim_parse_args(int argc, char **argv)
{ NULL }
};
int opt_idx;
- extern int main(int argc, char **arg);
+ extern int mynewt_main(int argc, char **arg);
#if MYNEWT_VAL(OS_SCHEDULING)
if (g_os_started) {
@@ -147,7 +147,7 @@ mcu_sim_parse_args(int argc, char **argv)
}
}
#if MYNEWT_VAL(OS_SCHEDULING)
- os_init(main);
+ os_init(mynewt_main);
os_start();
#endif
}
diff --git a/net/ip/lwip_base/test/fuzz/fuzz.c b/net/ip/lwip_base/test/fuzz/fuzz.c
index 858665c80..5b67fac4e 100644
--- a/net/ip/lwip_base/test/fuzz/fuzz.c
+++ b/net/ip/lwip_base/test/fuzz/fuzz.c
@@ -138,7 +138,8 @@ static void input_pkts(struct netif *netif, const u8_t *data, size_t len)
#endif /* LWIP_FUZZ_MULTI_PACKET */
}
-int main(int argc, char** argv)
+int
+mynewt_main(int argc, char **argv)
{
struct netif net_test;
ip4_addr_t addr;
[mynewt-core] 01/03: baselibc: Call mynewt_main() instead of main()
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 0adba9d68dcf950d44815d89ceafca8a4f048f41
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Wed Dec 1 14:31:25 2021 +0100
baselibc: Call mynewt_main() instead of main()
---
apps/bleprph_oic/src/main.c | 2 +-
apps/blesplit/src/main.c | 2 +-
apps/bleuart/src/main.c | 2 +-
apps/bsncent/src/main.c | 2 +-
apps/bsnprph/src/main.c | 2 +-
apps/bus_test/src/main.c | 2 +-
apps/buzzer/src/main.c | 2 +-
apps/crypto_test/src/main.c | 2 +-
apps/ffs2native/src/main.c | 2 +-
apps/fs_test/src/main.c | 2 +-
apps/hash_test/src/main.c | 2 +-
apps/iptest/src/main.c | 2 +-
apps/lora_app_shell/src/main.c | 2 +-
apps/loraping/src/main.c | 2 +-
apps/lorashell/src/main.c | 2 +-
apps/metrics/src/main.c | 2 +-
apps/ocf_sample/src/main.c | 2 +-
apps/osdp_sample/src/main.c | 2 +-
apps/pwm_test/src/main.c | 2 +-
apps/sensors_test/src/main.c | 2 +-
apps/slinky/src/main.c | 2 +-
apps/slinky_oic/src/main.c | 2 +-
apps/spitest/src/main.c | 2 +-
apps/splitty/src/main.c | 2 +-
apps/timtest/src/main.c | 2 +-
apps/trng_test/src/main.c | 2 +-
libc/baselibc/src/start.c | 6 +++---
27 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/apps/bleprph_oic/src/main.c b/apps/bleprph_oic/src/main.c
index 05040b556..23a180b84 100644
--- a/apps/bleprph_oic/src/main.c
+++ b/apps/bleprph_oic/src/main.c
@@ -362,7 +362,7 @@ static const oc_handler_t omgr_oc_handler = {
* @return int NOTE: this function should never return!
*/
int
-main(void)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/blesplit/src/main.c b/apps/blesplit/src/main.c
index a440f7f81..8fef1eff3 100644
--- a/apps/blesplit/src/main.c
+++ b/apps/blesplit/src/main.c
@@ -284,7 +284,7 @@ blesplit_on_sync(void)
* @return int NOTE: this function should never return!
*/
int
-main(void)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/bleuart/src/main.c b/apps/bleuart/src/main.c
index 098f29b77..d23a4dc84 100644
--- a/apps/bleuart/src/main.c
+++ b/apps/bleuart/src/main.c
@@ -195,7 +195,7 @@ bleuart_on_sync(void)
* @return int NOTE: this function should never return!
*/
int
-main(void)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/bsncent/src/main.c b/apps/bsncent/src/main.c
index 00b9aea6d..f616ba11a 100644
--- a/apps/bsncent/src/main.c
+++ b/apps/bsncent/src/main.c
@@ -411,7 +411,7 @@ bsncent_on_sync(void)
* @return int NOTE: this function should never return!
*/
int
-main(void)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/bsnprph/src/main.c b/apps/bsnprph/src/main.c
index bc6fec254..4b86ee749 100644
--- a/apps/bsnprph/src/main.c
+++ b/apps/bsnprph/src/main.c
@@ -318,7 +318,7 @@ bsnprph_on_sync(void)
* @return int NOTE: this function should never return!
*/
int
-main(void)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/bus_test/src/main.c b/apps/bus_test/src/main.c
index 4a43a7d6f..a4d54aebd 100644
--- a/apps/bus_test/src/main.c
+++ b/apps/bus_test/src/main.c
@@ -148,7 +148,7 @@ bme280_sensor_configure(void)
#endif
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/buzzer/src/main.c b/apps/buzzer/src/main.c
index a4a6a6cfb..da6b7bf4a 100755
--- a/apps/buzzer/src/main.c
+++ b/apps/buzzer/src/main.c
@@ -27,7 +27,7 @@
int count = 0;
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
sysinit();
diff --git a/apps/crypto_test/src/main.c b/apps/crypto_test/src/main.c
index 08ecb2104..cbe20ea61 100755
--- a/apps/crypto_test/src/main.c
+++ b/apps/crypto_test/src/main.c
@@ -935,7 +935,7 @@ run_iovec_test(struct crypto_dev *crypto)
#endif /* MYNEWT_VAL(CRYPTOTEST_IOVEC) */
int
-main(void)
+mynewt_main(int argc, char **argv)
{
struct crypto_dev *crypto;
#if MYNEWT_VAL(CRYPTOTEST_BENCHMARK)
diff --git a/apps/ffs2native/src/main.c b/apps/ffs2native/src/main.c
index 2a7323c1d..1d88f4a39 100644
--- a/apps/ffs2native/src/main.c
+++ b/apps/ffs2native/src/main.c
@@ -626,7 +626,7 @@ usage(int rc)
}
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
FILE *fp;
int fd;
diff --git a/apps/fs_test/src/main.c b/apps/fs_test/src/main.c
index 7246a9479..5d5a8288d 100644
--- a/apps/fs_test/src/main.c
+++ b/apps/fs_test/src/main.c
@@ -433,7 +433,7 @@ init_tasks(void)
}
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
#ifdef ARCH_sim
mcu_sim_parse_args(argc, argv);
diff --git a/apps/hash_test/src/main.c b/apps/hash_test/src/main.c
index 8345d63c1..fd1a51f0b 100755
--- a/apps/hash_test/src/main.c
+++ b/apps/hash_test/src/main.c
@@ -580,7 +580,7 @@ run_concurrency_test(struct hash_dev *hash)
}
int
-main(void)
+mynewt_main(int argc, char **argv)
{
struct hash_dev *hash;
struct hash_sha256_context hash_sha256;
diff --git a/apps/iptest/src/main.c b/apps/iptest/src/main.c
index c0ca241bd..9d940b301 100644
--- a/apps/iptest/src/main.c
+++ b/apps/iptest/src/main.c
@@ -414,7 +414,7 @@ omgr_app_init(void)
* @return int NOTE: this function should never return!
*/
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
#ifdef ARCH_sim
mcu_sim_parse_args(argc, argv);
diff --git a/apps/lora_app_shell/src/main.c b/apps/lora_app_shell/src/main.c
index 13bb578af..8759fc87e 100644
--- a/apps/lora_app_shell/src/main.c
+++ b/apps/lora_app_shell/src/main.c
@@ -135,7 +135,7 @@ static const oc_handler_t omgr_oc_handler = {
};
int
-main(void)
+mynewt_main(int argc, char **argv)
{
#ifdef ARCH_sim
mcu_sim_parse_args(argc, argv);
diff --git a/apps/loraping/src/main.c b/apps/loraping/src/main.c
index 85c507f8b..1cb91fbdb 100644
--- a/apps/loraping/src/main.c
+++ b/apps/loraping/src/main.c
@@ -213,7 +213,7 @@ on_rx_error(void)
}
int
-main(void)
+mynewt_main(int argc, char **argv)
{
RadioEvents_t radio_events;
diff --git a/apps/lorashell/src/main.c b/apps/lorashell/src/main.c
index 98aad07d3..283fc9165 100644
--- a/apps/lorashell/src/main.c
+++ b/apps/lorashell/src/main.c
@@ -470,7 +470,7 @@ err:
}
int
-main(void)
+mynewt_main(int argc, char **argv)
{
RadioEvents_t radio_events;
int rc;
diff --git a/apps/metrics/src/main.c b/apps/metrics/src/main.c
index b5f9671a7..efaf144ea 100755
--- a/apps/metrics/src/main.c
+++ b/apps/metrics/src/main.c
@@ -97,7 +97,7 @@ init_log_instance(void)
}
int
-main(void)
+mynewt_main(int argc, char **argv)
{
struct os_mbuf *om;
int i;
diff --git a/apps/ocf_sample/src/main.c b/apps/ocf_sample/src/main.c
index 3a3804e9c..e120de19d 100644
--- a/apps/ocf_sample/src/main.c
+++ b/apps/ocf_sample/src/main.c
@@ -240,7 +240,7 @@ ocf_init_tasks(void)
}
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
#ifdef ARCH_sim
mcu_sim_parse_args(argc, argv);
diff --git a/apps/osdp_sample/src/main.c b/apps/osdp_sample/src/main.c
index 54dc97cee..490a93a10 100644
--- a/apps/osdp_sample/src/main.c
+++ b/apps/osdp_sample/src/main.c
@@ -309,7 +309,7 @@ test_encryption_wrappers(uint8_t *key, uint8_t len)
}
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc, len;
uint8_t key_buf[16];
diff --git a/apps/pwm_test/src/main.c b/apps/pwm_test/src/main.c
index 9af6c66a7..278c775d7 100644
--- a/apps/pwm_test/src/main.c
+++ b/apps/pwm_test/src/main.c
@@ -172,7 +172,7 @@ pwm_init(struct pwm_dev *pwm_dev, int pin)
}
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
sysinit();
diff --git a/apps/sensors_test/src/main.c b/apps/sensors_test/src/main.c
index 37399c051..89843dea2 100644
--- a/apps/sensors_test/src/main.c
+++ b/apps/sensors_test/src/main.c
@@ -449,7 +449,7 @@ sensor_ble_oic_server_init(void)
* @return int NOTE: this function should never return!
*/
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
#ifdef ARCH_sim
diff --git a/apps/slinky/src/main.c b/apps/slinky/src/main.c
index e35230396..d95b166c9 100644
--- a/apps/slinky/src/main.c
+++ b/apps/slinky/src/main.c
@@ -215,7 +215,7 @@ init_tasks(void)
* @return int NOTE: this function should never return!
*/
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/slinky_oic/src/main.c b/apps/slinky_oic/src/main.c
index 5d38f6b9b..4a41a2619 100644
--- a/apps/slinky_oic/src/main.c
+++ b/apps/slinky_oic/src/main.c
@@ -252,7 +252,7 @@ init_tasks(void)
* @return int NOTE: this function should never return!
*/
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/spitest/src/main.c b/apps/spitest/src/main.c
index 3374078fd..4b600dcde 100644
--- a/apps/spitest/src/main.c
+++ b/apps/spitest/src/main.c
@@ -426,7 +426,7 @@ init_tasks(void)
* @return int NOTE: this function should never return!
*/
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/splitty/src/main.c b/apps/splitty/src/main.c
index 8ef8820d6..d1a897556 100644
--- a/apps/splitty/src/main.c
+++ b/apps/splitty/src/main.c
@@ -174,7 +174,7 @@ init_tasks(void)
* @return int NOTE: this function should never return!
*/
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/timtest/src/main.c b/apps/timtest/src/main.c
index 7b348e65a..a8b60be91 100644
--- a/apps/timtest/src/main.c
+++ b/apps/timtest/src/main.c
@@ -191,7 +191,7 @@ init_tasks(void)
* @return int NOTE: this function should never return!
*/
int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
{
int rc;
diff --git a/apps/trng_test/src/main.c b/apps/trng_test/src/main.c
index 1d20a9e6b..bef440218 100755
--- a/apps/trng_test/src/main.c
+++ b/apps/trng_test/src/main.c
@@ -142,7 +142,7 @@ test_byte_distribution(uint8_t *buf, uint32_t bitlen)
}
int
-main(void)
+mynewt_main(int argc, char **argv)
{
struct trng_dev *trng;
size_t size;
diff --git a/libc/baselibc/src/start.c b/libc/baselibc/src/start.c
index 7b124722f..fc63f74b0 100644
--- a/libc/baselibc/src/start.c
+++ b/libc/baselibc/src/start.c
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include "os/mynewt.h"
-extern int main(int argc, char **argv);
+extern int mynewt_main(int, char **);
void __libc_init_array(void);
/*
@@ -40,10 +40,10 @@ void _start(void)
#if !MYNEWT_VAL(OS_SCHEDULING)
int rc;
- rc = main(0, NULL);
+ rc = mynewt_main(0, NULL);
exit(rc);
#else
- os_init(main);
+ os_init(mynewt_main);
os_start();
#endif
}
[mynewt-core] 03/03: Provide mynewt_main in linker scripts
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 8a8077215e7d8166ce67aff30cf742da74fe5c93
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed Jun 14 06:37:58 2023 +0200
Provide mynewt_main in linker scripts
---
hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld | 1 +
hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld | 1 +
hw/bsp/hifive1/hifive1.ld | 1 +
hw/bsp/usbmkw41z/boot-mkw41z512.ld | 1 +
hw/bsp/usbmkw41z/mkw41z512.ld | 1 +
hw/bsp/usbmkw41z/no-boot-mkw41z512.ld | 1 +
hw/mcu/ambiq/apollo2/apollo2.ld | 1 +
hw/mcu/ambiq/apollo3/apollo3.ld | 3 +-
hw/mcu/dialog/da1469x/da1469x.ld | 1 +
hw/mcu/dialog/da1469x/da1469x_ram_resident.ld | 1 +
hw/mcu/nordic/nrf51xxx/nrf51.ld | 1 +
hw/mcu/nordic/nrf52xxx/nrf52.ld | 1 +
hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld | 1 +
hw/mcu/nordic/nrf5340/nrf5340.ld | 1 +
hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld | 1 +
hw/mcu/nordic/nrf5340_net/nrf5340_net.ld | 1 +
.../nordic/nrf5340_net/nrf5340_net_ram_resident.ld | 1 +
hw/mcu/nordic/nrf91xx/nrf91.ld | 1 +
hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld | 1 +
hw/mcu/stm/stm32f0xx/stm32f0xx.ld | 1 +
hw/mcu/stm/stm32f1xx/stm32f103.ld | 1 +
hw/mcu/stm/stm32f3xx/stm32f303.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f401.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f407.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f411.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f413.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f427.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f429.ld | 1 +
hw/mcu/stm/stm32f4xx/stm32f439.ld | 1 +
hw/mcu/stm/stm32f7xx/stm32f746.ld | 1 +
hw/mcu/stm/stm32f7xx/stm32f767.ld | 1 +
hw/mcu/stm/stm32h7xx/stm32h723.ld | 1 +
hw/mcu/stm/stm32l0xx/stm32l072.ld | 1 +
hw/mcu/stm/stm32l0xx/stm32l073.ld | 1 +
hw/mcu/stm/stm32l1xx/stm32l152.ld | 1 +
hw/mcu/stm/stm32l4xx/stm32l476.ld | 1 +
hw/mcu/stm/stm32u5xx/stm32u5xx.ld | 1 +
hw/mcu/stm/stm32wbxx/stm32wb55.ld | 116 +++++++++++----------
libc/baselibc/pkg.yml | 1 +
39 files changed, 101 insertions(+), 55 deletions(-)
diff --git a/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld b/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
index a14123a64..a3276b2a7 100644
--- a/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
+++ b/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
@@ -104,6 +104,7 @@ SECTIONS
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld b/hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld
index 55aace42e..ccf5b652b 100644
--- a/hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld
+++ b/hw/bsp/frdm-k82f/MK82FN256xxx15_flash.ld
@@ -73,6 +73,7 @@ SECTIONS
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/bsp/hifive1/hifive1.ld b/hw/bsp/hifive1/hifive1.ld
index 40ff08b1b..accf18a2d 100644
--- a/hw/bsp/hifive1/hifive1.ld
+++ b/hw/bsp/hifive1/hifive1.ld
@@ -42,6 +42,7 @@ SECTIONS
*(.text.startup .text.startup.*)
*(.text .text.*)
*(.gnu.linkonce.t.*)
+ PROVIDE(mynewt_main = main);
} >flash
.fini :
diff --git a/hw/bsp/usbmkw41z/boot-mkw41z512.ld b/hw/bsp/usbmkw41z/boot-mkw41z512.ld
index 58612c76c..99c766a0d 100644
--- a/hw/bsp/usbmkw41z/boot-mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/boot-mkw41z512.ld
@@ -101,6 +101,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/bsp/usbmkw41z/mkw41z512.ld b/hw/bsp/usbmkw41z/mkw41z512.ld
index e07d64f7c..491a1ac40 100644
--- a/hw/bsp/usbmkw41z/mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/mkw41z512.ld
@@ -91,6 +91,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld b/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
index 9889c0f92..6dff11457 100644
--- a/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
@@ -101,6 +101,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/ambiq/apollo2/apollo2.ld b/hw/mcu/ambiq/apollo2/apollo2.ld
index 7ab6323b6..3c15b58fe 100644
--- a/hw/mcu/ambiq/apollo2/apollo2.ld
+++ b/hw/mcu/ambiq/apollo2/apollo2.ld
@@ -83,6 +83,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
diff --git a/hw/mcu/ambiq/apollo3/apollo3.ld b/hw/mcu/ambiq/apollo3/apollo3.ld
index 4dfc53706..b2f308311 100644
--- a/hw/mcu/ambiq/apollo3/apollo3.ld
+++ b/hw/mcu/ambiq/apollo3/apollo3.ld
@@ -46,6 +46,7 @@ SECTIONS
*(.rodata)
*(.rodata*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
@@ -149,4 +150,4 @@ SECTIONS
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__HeapBase <= __HeapLimit, "region RAM overflowed with stack")
-}
\ No newline at end of file
+}
diff --git a/hw/mcu/dialog/da1469x/da1469x.ld b/hw/mcu/dialog/da1469x/da1469x.ld
index e1ff35452..9f1e29bd5 100644
--- a/hw/mcu/dialog/da1469x/da1469x.ld
+++ b/hw/mcu/dialog/da1469x/da1469x.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/dialog/da1469x/da1469x_ram_resident.ld b/hw/mcu/dialog/da1469x/da1469x_ram_resident.ld
index b12dac458..0caf676f2 100644
--- a/hw/mcu/dialog/da1469x/da1469x_ram_resident.ld
+++ b/hw/mcu/dialog/da1469x/da1469x_ram_resident.ld
@@ -73,6 +73,7 @@ SECTIONS
*(.eh_frame*)
. = ALIGN(4);
+ PROVIDE(mynewt_main = main);
} > RAM
.ARM.extab :
diff --git a/hw/mcu/nordic/nrf51xxx/nrf51.ld b/hw/mcu/nordic/nrf51xxx/nrf51.ld
index 55070815a..ea89e0f3e 100644
--- a/hw/mcu/nordic/nrf51xxx/nrf51.ld
+++ b/hw/mcu/nordic/nrf51xxx/nrf51.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf52xxx/nrf52.ld b/hw/mcu/nordic/nrf52xxx/nrf52.ld
index f3f8b4cbe..af7de107e 100644
--- a/hw/mcu/nordic/nrf52xxx/nrf52.ld
+++ b/hw/mcu/nordic/nrf52xxx/nrf52.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld b/hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld
index 1819bd327..f482248ee 100644
--- a/hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld
+++ b/hw/mcu/nordic/nrf52xxx/nrf52_ram_resident.ld
@@ -98,6 +98,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > RAM
diff --git a/hw/mcu/nordic/nrf5340/nrf5340.ld b/hw/mcu/nordic/nrf5340/nrf5340.ld
index e29139a89..d8e27e769 100644
--- a/hw/mcu/nordic/nrf5340/nrf5340.ld
+++ b/hw/mcu/nordic/nrf5340/nrf5340.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld b/hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld
index 3f1d89c6e..05dfd466e 100644
--- a/hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld
+++ b/hw/mcu/nordic/nrf5340/nrf5340_ram_resident.ld
@@ -98,6 +98,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > RAM
diff --git a/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld b/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld
index 9a6426432..f235d6d5f 100644
--- a/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld
+++ b/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf5340_net/nrf5340_net_ram_resident.ld b/hw/mcu/nordic/nrf5340_net/nrf5340_net_ram_resident.ld
index 1819bd327..f482248ee 100644
--- a/hw/mcu/nordic/nrf5340_net/nrf5340_net_ram_resident.ld
+++ b/hw/mcu/nordic/nrf5340_net/nrf5340_net_ram_resident.ld
@@ -98,6 +98,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > RAM
diff --git a/hw/mcu/nordic/nrf91xx/nrf91.ld b/hw/mcu/nordic/nrf91xx/nrf91.ld
index f3f8b4cbe..af7de107e 100644
--- a/hw/mcu/nordic/nrf91xx/nrf91.ld
+++ b/hw/mcu/nordic/nrf91xx/nrf91.ld
@@ -102,6 +102,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > FLASH
diff --git a/hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld b/hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld
index 1819bd327..f482248ee 100644
--- a/hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld
+++ b/hw/mcu/nordic/nrf91xx/nrf91_ram_resident.ld
@@ -98,6 +98,7 @@ SECTIONS
*(.rodata*)
*(.eh_frame*)
+ PROVIDE(mynewt_main = main);
. = ALIGN(4);
} > RAM
diff --git a/hw/mcu/stm/stm32f0xx/stm32f0xx.ld b/hw/mcu/stm/stm32f0xx/stm32f0xx.ld
index 997c6de2d..a9602ac84 100644
--- a/hw/mcu/stm/stm32f0xx/stm32f0xx.ld
+++ b/hw/mcu/stm/stm32f0xx/stm32f0xx.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f1xx/stm32f103.ld b/hw/mcu/stm/stm32f1xx/stm32f103.ld
index 5e0b49702..5a646e5ee 100644
--- a/hw/mcu/stm/stm32f1xx/stm32f103.ld
+++ b/hw/mcu/stm/stm32f1xx/stm32f103.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f3xx/stm32f303.ld b/hw/mcu/stm/stm32f3xx/stm32f303.ld
index bf89bb4aa..b7ee776c3 100644
--- a/hw/mcu/stm/stm32f3xx/stm32f303.ld
+++ b/hw/mcu/stm/stm32f3xx/stm32f303.ld
@@ -111,6 +111,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f401.ld b/hw/mcu/stm/stm32f4xx/stm32f401.ld
index 75fc436d8..40a35de32 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f401.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f401.ld
@@ -108,6 +108,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f407.ld b/hw/mcu/stm/stm32f4xx/stm32f407.ld
index 1943af642..51eaa3b47 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f407.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f407.ld
@@ -108,6 +108,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f411.ld b/hw/mcu/stm/stm32f4xx/stm32f411.ld
index 75fc436d8..40a35de32 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f411.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f411.ld
@@ -108,6 +108,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f413.ld b/hw/mcu/stm/stm32f4xx/stm32f413.ld
index ab253afb1..7615341cd 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f413.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f413.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f427.ld b/hw/mcu/stm/stm32f4xx/stm32f427.ld
index 1943af642..51eaa3b47 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f427.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f427.ld
@@ -108,6 +108,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f429.ld b/hw/mcu/stm/stm32f4xx/stm32f429.ld
index 134ab0db6..e473e33ff 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f429.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f429.ld
@@ -111,6 +111,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f4xx/stm32f439.ld b/hw/mcu/stm/stm32f4xx/stm32f439.ld
index 134ab0db6..e473e33ff 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f439.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f439.ld
@@ -111,6 +111,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f7xx/stm32f746.ld b/hw/mcu/stm/stm32f7xx/stm32f746.ld
index f0a430eac..2b017b47a 100644
--- a/hw/mcu/stm/stm32f7xx/stm32f746.ld
+++ b/hw/mcu/stm/stm32f7xx/stm32f746.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32f7xx/stm32f767.ld b/hw/mcu/stm/stm32f7xx/stm32f767.ld
index f0a430eac..2b017b47a 100644
--- a/hw/mcu/stm/stm32f7xx/stm32f767.ld
+++ b/hw/mcu/stm/stm32f7xx/stm32f767.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32h7xx/stm32h723.ld b/hw/mcu/stm/stm32h7xx/stm32h723.ld
index 54a43b5a5..2e41eed0b 100644
--- a/hw/mcu/stm/stm32h7xx/stm32h723.ld
+++ b/hw/mcu/stm/stm32h7xx/stm32h723.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32l0xx/stm32l072.ld b/hw/mcu/stm/stm32l0xx/stm32l072.ld
index 8e62759a5..15b0a8007 100644
--- a/hw/mcu/stm/stm32l0xx/stm32l072.ld
+++ b/hw/mcu/stm/stm32l0xx/stm32l072.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32l0xx/stm32l073.ld b/hw/mcu/stm/stm32l0xx/stm32l073.ld
index 8e62759a5..15b0a8007 100644
--- a/hw/mcu/stm/stm32l0xx/stm32l073.ld
+++ b/hw/mcu/stm/stm32l0xx/stm32l073.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32l1xx/stm32l152.ld b/hw/mcu/stm/stm32l1xx/stm32l152.ld
index 5e0b49702..5a646e5ee 100644
--- a/hw/mcu/stm/stm32l1xx/stm32l152.ld
+++ b/hw/mcu/stm/stm32l1xx/stm32l152.ld
@@ -110,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32l4xx/stm32l476.ld b/hw/mcu/stm/stm32l4xx/stm32l476.ld
index 26f817624..e0b6bf2cf 100644
--- a/hw/mcu/stm/stm32l4xx/stm32l476.ld
+++ b/hw/mcu/stm/stm32l4xx/stm32l476.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32u5xx/stm32u5xx.ld b/hw/mcu/stm/stm32u5xx/stm32u5xx.ld
index 26f817624..e0b6bf2cf 100644
--- a/hw/mcu/stm/stm32u5xx/stm32u5xx.ld
+++ b/hw/mcu/stm/stm32u5xx/stm32u5xx.ld
@@ -109,6 +109,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
diff --git a/hw/mcu/stm/stm32wbxx/stm32wb55.ld b/hw/mcu/stm/stm32wbxx/stm32wb55.ld
index c408dea42..bc61dc028 100644
--- a/hw/mcu/stm/stm32wbxx/stm32wb55.ld
+++ b/hw/mcu/stm/stm32wbxx/stm32wb55.ld
@@ -1,54 +1,59 @@
-/**
-*****************************************************************************
-**
-** File : stm32wb55xx_flash_cm4.ld
-**
-** Abstract : System Workbench Minimal System calls file
-**
-** For more information about which c-functions
-** need which of these lowlevel functions
-** please consult the Newlib libc-manual
-**
-** Environment : System Workbench for MCU
-**
-** Distribution: The file is distributed “as is,” without any warranty
-** of any kind.
-**
-*****************************************************************************
-**
-** <h2><center>© COPYRIGHT(c) 2019 Ac6</center></h2>
-**
-** Redistribution and use in source and binary forms, with or without modification,
-** are permitted provided that the following conditions are met:
-** 1. Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** 2. Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** 3. Neither the name of Ac6 nor the names of its contributors
-** may be used to endorse or promote products derived from this software
-** without specific prior written permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* Linker script to place sections and symbol values. Should be used together
+ * with other linker script that defines memory regions FLASH and RAM.
+ * It references following symbols, which must be defined in code:
+ * Reset_Handler : Entry of reset handler
+ *
+ * It defines following symbols, which code can use without definition:
+ * __exidx_start
+ * __exidx_end
+ * __etext
+ * __data_start__
+ * __preinit_array_start
+ * __preinit_array_end
+ * __init_array_start
+ * __init_array_end
+ * __fini_array_start
+ * __fini_array_end
+ * __data_end__
+ * __bss_start__
+ * __bss_end__
+ * __end__
+ * end
+ * __HeapBase
+ * __HeapLimit
+ * __StackLimit
+ * __StackTop
+ * __stack
+ * __coredata_start__
+ * __coredata_end__
+ * __corebss_start__
+ * __corebss_end__
+ * __ecoredata
+ * __ecorebss
+ */
ENTRY(Reset_Handler)
_estack = ORIGIN(RAM) + LENGTH(RAM);
-/* Define output sections */
SECTIONS
{
/* Reserve space at the start of the image for the header. */
@@ -57,9 +62,10 @@ SECTIONS
. = . + _imghdr_size;
} > FLASH
+ __text = .;
+
.text :
{
- . = ALIGN(8);
__isr_vector_start = .;
KEEP(*(.isr_vector))
__isr_vector_end = .;
@@ -73,14 +79,14 @@ SECTIONS
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
- . = ALIGN(8);
+ . = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
- . = ALIGN(8);
+ . = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP(*(SORT(.fini_array.*)))
@@ -104,6 +110,7 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
+ PROVIDE(mynewt_main = main);
} > FLASH
.ARM.extab :
@@ -123,16 +130,17 @@ SECTIONS
.vector_relocation :
{
- . = ALIGN(8);
+ . = ALIGN(4);
__vector_tbl_reloc__ = .;
. = . + (__isr_vector_end - __isr_vector_start);
+ . = ALIGN(4);
} > RAM
.coredata :
{
- . = ALIGN(8);
__coredata_start__ = .;
*(.data.core)
+ . = ALIGN(4);
__coredata_end__ = .;
} > RAM AT > FLASH
@@ -142,14 +150,14 @@ SECTIONS
.data :
{
- . = ALIGN(8);
+ . = ALIGN(4);
_sdata = .;
__data_start__ = _sdata;
*(vtable)
*(.data*)
KEEP(*(.jcr*))
- . = ALIGN(8);
+ . = ALIGN(4);
/* All data end */
_edata = .;
__data_end__ = _edata;
diff --git a/libc/baselibc/pkg.yml b/libc/baselibc/pkg.yml
index b751946e8..ee7ff016b 100644
--- a/libc/baselibc/pkg.yml
+++ b/libc/baselibc/pkg.yml
@@ -36,3 +36,4 @@ pkg.cflags:
pkg.lflags:
- -specs=nosys.specs:
+ - -umain