Updater scripts Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
tzarc
Posts: 12
Joined: Thu Feb 20, 2020 7:08 am
Has thanked: 2 times
Been thanked: 5 times

Updater scripts  Topic is solved

Postby tzarc » Sun Mar 01, 2020 7:43 am

Figured I'd just make a new thread, with respect to the updater scripts currently in the repo.

With QMK keyboard firmware, we currently have a small set of currently-used STM32 parts:
- STM32F042 - no updater
- STM32F072 - no udpater
- STM32F103 - no updater
- STM32F303
- STM32F411 - no updater, but two others exist from the same family

Obviously some of these aren't currently supported via upgrade script -- the F042/F072/F103/F411 -- would it be an awful bother to get these added? Or would it be easier if I were to attempt to get an initial implementation going so you can get it upstreamed?

As a sidenote, I've also been attempting to get things going with currently-supported upgrade scripts, for:
- STM32L07x
- STM32G4x1
- STM32G4x4

The L07x (L072) script does not currently inject the USB definitions:

Code: Select all

/*
 * USB driver system settings.
 */
#define STM32_USB_USE_USB1                  TRUE
#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE
#define STM32_USB_USB1_HP_IRQ_PRIORITY      0
#define STM32_USB_USB1_LP_IRQ_PRIORITY      0


And the output from both the G4x1 and G4x4 scripts currently fail with the following errors:

Code: Select all

lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c                                      In file included from keyboards/handwired/onekey/nucleo64_g431rb/halconf.h:34:0,
                 from ./lib/chibios/os/hal/include/hal.h:30,
                 from lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c:25:
lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c: In function 'hal_lld_init':
keyboards/handwired/onekey/nucleo64_g431rb/mcuconf.h:43:46: error: 'STM32_PLS_LEV0' undeclared (first use in this function)
 #define STM32_PWR_CR2                       (STM32_PLS_LEV0 | STM32_PVDE_DISABLED)
                                              ^
lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c:119:14: note: in expansion of macro 'STM32_PWR_CR2'
   PWR->CR2 = STM32_PWR_CR2;
              ^~~~~~~~~~~~~
keyboards/handwired/onekey/nucleo64_g431rb/mcuconf.h:43:46: note: each undeclared identifier is reported only once for each function it appears in
 #define STM32_PWR_CR2                       (STM32_PLS_LEV0 | STM32_PVDE_DISABLED)
                                              ^
lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c:119:14: note: in expansion of macro 'STM32_PWR_CR2'
   PWR->CR2 = STM32_PWR_CR2;
              ^~~~~~~~~~~~~
keyboards/handwired/onekey/nucleo64_g431rb/mcuconf.h:43:63: error: 'STM32_PVDE_DISABLED' undeclared (first use in this function)
 #define STM32_PWR_CR2                       (STM32_PLS_LEV0 | STM32_PVDE_DISABLED)
                                                               ^
lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c:119:14: note: in expansion of macro 'STM32_PWR_CR2'
   PWR->CR2 = STM32_PWR_CR2;
              ^~~~~~~~~~~~~
lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c: In function 'stm32_clock_init':
keyboards/handwired/onekey/nucleo64_g431rb/mcuconf.h:43:46: error: 'STM32_PLS_LEV0' undeclared (first use in this function)
 #define STM32_PWR_CR2                       (STM32_PLS_LEV0 | STM32_PVDE_DISABLED)
                                              ^
lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c:156:14: note: in expansion of macro 'STM32_PWR_CR2'
   PWR->CR2 = STM32_PWR_CR2;
              ^~~~~~~~~~~~~
keyboards/handwired/onekey/nucleo64_g431rb/mcuconf.h:43:63: error: 'STM32_PVDE_DISABLED' undeclared (first use in this function)
 #define STM32_PWR_CR2                       (STM32_PLS_LEV0 | STM32_PVDE_DISABLED)
                                                               ^
lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.c:156:14: note: in expansion of macro 'STM32_PWR_CR2'
   PWR->CR2 = STM32_PWR_CR2;
              ^~~~~~~~~~~~~
 [ERRORS]
 |
 |
 |
tmk_core/rules.mk:377: recipe for target '.build/obj_handwired_onekey_nucleo64_g431rb/lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.o' failed
make[1]: *** [.build/obj_handwired_onekey_nucleo64_g431rb/lib/chibios/os/hal/ports/STM32/STM32G4xx/hal_lld.o] Error 1

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Updater scripts

Postby Giovanni » Sun Mar 01, 2020 8:19 am

Hi,

Adding scripts is not that difficult, you may try. The problem is to hunt all the mcuconf.h files and add the macro that allows the script to recognize them as a target.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Updater scripts

Postby Giovanni » Sun Mar 08, 2020 9:50 am

I updated the L07x script, the G4 one is correct, it does not replace existing definitions regardless if those are valid or not, you need to adjust the mcuconf.h manually or delete the faulty define then run the updater.

Giovanni

tzarc
Posts: 12
Joined: Thu Feb 20, 2020 7:08 am
Has thanked: 2 times
Been thanked: 5 times

Re: Updater scripts

Postby tzarc » Tue Mar 17, 2020 12:45 am

Great, thanks!


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 15 guests