Remora - Rpi Software Stepping Using External Microcontroller via SPI

More
More
5 years 1 week ago #223718 by scotta
Hi, I've created a new thread to capture testing issues for Remora 1.0.0 that supports STM32F4 boards.

www.forum.linuxcnc.org/18-computer/43988...d-for-testing#223716

Appreciate any feedback and issues.

Thanks
Scott

Please Log in to join the conversation.

More
5 years 1 week ago #224009 by cakeslob
Trying to do a port to the 446 because there are some pretty nice boards with the 446. I had to (get a new computer thats 64bit(I hate windows10 so much)) change a few files it looks like a lot is stripped down for just 407, almost got it to compile (I think) but I am now stuck, if you have any insight you can provide, that would be appreciated. And your patience is appreciated.

I dont know what to do with the RNG/RTC stuff, like where to define or disable, and probably the build offset needs to change but im not finding one in the marlin source for it.
Code:
Building project firmware (OCTOPUSV1.1, ARMC6) Scan: OS5-SKRv2-Remora Using ROM region application in this build. Region application: size 0x78000, offset 0x8008000 Compile [100.0%]: trng_api.c [Warning] <command line>@30,25: ISO C99 requires whitespace after the macro name [-Wc99-extensions] [Error] trng_api.c@98,5: use of undeclared identifier 'RCC_AHB2ENR_RNGEN' [Error] trng_api.c@98,5: use of undeclared identifier 'RCC_AHB2ENR_RNGEN' [Error] trng_api.c@101,8: incomplete definition of type 'struct trng_s' [Error] trng_api.c@101,28: use of undeclared identifier 'RNG' [Error] trng_api.c@102,8: incomplete definition of type 'struct trng_s' [Error] trng_api.c@102,25: use of undeclared identifier 'HAL_RNG_STATE_RESET'; did you mean 'HAL_RTC_STATE_RESET'? [Error] trng_api.c@103,8: incomplete definition of type 'struct trng_s' [Warning] trng_api.c@112,9: implicit declaration of function 'HAL_RNG_Init' is invalid in C99 [-Wimplicit-function-declaration] [Error] trng_api.c@112,26: incomplete definition of type 'struct trng_s' [Warning] trng_api.c@117,9: implicit declaration of function 'HAL_RNG_GenerateRandomNumber' is invalid in C99 [-Wimplicit-function-declaration] [Error] trng_api.c@117,42: incomplete definition of type 'struct trng_s' [Warning] trng_api.c@133,5: implicit declaration of function 'HAL_RNG_DeInit' is invalid in C99 [-Wimplicit-function-declaration] [Error] trng_api.c@133,24: incomplete definition of type 'struct trng_s' [Error] trng_api.c@140,5: use of undeclared identifier 'RCC_AHB2ENR_RNGEN' [Warning] trng_api.c@159,13: implicit declaration of function 'HAL_RNG_GenerateRandomNumber' is invalid in C99 [-Wimplicit-function-declaration] [Error] trng_api.c@159,46: incomplete definition of type 'struct trng_s' [Warning] trng_api.c@171,10: implicit declaration of function '__HAL_RNG_GET_FLAG' is invalid in C99 [-Wimplicit-function-declaration] [Error] trng_api.c@171,33: incomplete definition of type 'struct trng_s' [Error] trng_api.c@171,44: use of undeclared identifier 'RNG_FLAG_CECS' [Error] trng_api.c@171,60: use of undeclared identifier 'RNG_FLAG_SECS' [ERROR] In file included from <built-in>:371: <command line>:30:25: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions] #define TARGET_OCTOPUSV1.1 1 ^ .\mbed-os\targets\TARGET_STM\trng_api.c:98:5: error: use of undeclared identifier 'RCC_AHB2ENR_RNGEN' __HAL_RCC_RNG_CLK_ENABLE(); ^ ./mbed-os/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_rcc_ex.h:4058:63: note: expanded from macro '__HAL_RCC_RNG_CLK_ENABLE' SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN);\ ^ .\mbed-os\targets\TARGET_STM\trng_api.c:98:5: error: use of undeclared identifier 'RCC_AHB2ENR_RNGEN' ./mbed-os/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_rcc_ex.h:4060:73: note: expanded from macro '__HAL_RCC_RNG_CLK_ENABLE' tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN);\ ^ .\mbed-os\targets\TARGET_STM\trng_api.c:101:8: error: incomplete definition of type 'struct trng_s' obj->handle.Instance = RNG; ~~~^ ./mbed-os/hal\trng_api.h:30:16: note: forward declaration of 'struct trng_s' typedef struct trng_s trng_t; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:101:28: error: use of undeclared identifier 'RNG' obj->handle.Instance = RNG; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:102:8: error: incomplete definition of type 'struct trng_s' obj->handle.State = HAL_RNG_STATE_RESET; ~~~^ ./mbed-os/hal\trng_api.h:30:16: note: forward declaration of 'struct trng_s' typedef struct trng_s trng_t; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:102:25: error: use of undeclared identifier 'HAL_RNG_STATE_RESET'; did you mean 'HAL_RTC_STATE_RESET'? obj->handle.State = HAL_RNG_STATE_RESET; ^~~~~~~~~~~~~~~~~~~ HAL_RTC_STATE_RESET ./mbed-os/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_rtc.h:66:3: note: 'HAL_RTC_STATE_RESET' declared here HAL_RTC_STATE_RESET = 0x00U, /*!< RTC not yet initialized or disabled */ ^ .\mbed-os\targets\TARGET_STM\trng_api.c:103:8: error: incomplete definition of type 'struct trng_s' obj->handle.Lock = HAL_UNLOCKED; ~~~^ ./mbed-os/hal\trng_api.h:30:16: note: forward declaration of 'struct trng_s' typedef struct trng_s trng_t; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:112:9: warning: implicit declaration of function 'HAL_RNG_Init' is invalid in C99 [-Wimplicit-function-declaration] if (HAL_RNG_Init(&obj->handle) != HAL_OK) { ^ .\mbed-os\targets\TARGET_STM\trng_api.c:112:26: error: incomplete definition of type 'struct trng_s' if (HAL_RNG_Init(&obj->handle) != HAL_OK) { ~~~^ ./mbed-os/hal\trng_api.h:30:16: note: forward declaration of 'struct trng_s' typedef struct trng_s trng_t; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:117:9: warning: implicit declaration of function 'HAL_RNG_GenerateRandomNumber' is invalid in C99 [-Wimplicit-function-declaration] if (HAL_RNG_GenerateRandomNumber(&obj->handle, &dummy) != HAL_OK) { ^ .\mbed-os\targets\TARGET_STM\trng_api.c:117:42: error: incomplete definition of type 'struct trng_s' if (HAL_RNG_GenerateRandomNumber(&obj->handle, &dummy) != HAL_OK) { ~~~^ ./mbed-os/hal\trng_api.h:30:16: note: forward declaration of 'struct trng_s' typedef struct trng_s trng_t; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:133:5: warning: implicit declaration of function 'HAL_RNG_DeInit' is invalid in C99 [-Wimplicit-function-declaration] HAL_RNG_DeInit(&obj->handle); ^ .\mbed-os\targets\TARGET_STM\trng_api.c:133:24: error: incomplete definition of type 'struct trng_s' HAL_RNG_DeInit(&obj->handle); ~~~^ ./mbed-os/hal\trng_api.h:30:16: note: forward declaration of 'struct trng_s' typedef struct trng_s trng_t; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:140:5: error: use of undeclared identifier 'RCC_AHB2ENR_RNGEN' __HAL_RCC_RNG_CLK_DISABLE(); ^ ./mbed-os/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_rcc_ex.h:4063:58: note: expanded from macro '__HAL_RCC_RNG_CLK_DISABLE' #define __HAL_RCC_RNG_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_RNGEN)) ^ .\mbed-os\targets\TARGET_STM\trng_api.c:159:13: warning: implicit declaration of function 'HAL_RNG_GenerateRandomNumber' is invalid in C99 [-Wimplicit-function-declaration] if (HAL_RNG_GenerateRandomNumber(&obj->handle, (uint32_t *)random) != HAL_OK) { ^ .\mbed-os\targets\TARGET_STM\trng_api.c:159:46: error: incomplete definition of type 'struct trng_s' if (HAL_RNG_GenerateRandomNumber(&obj->handle, (uint32_t *)random) != HAL_OK) { ~~~^ ./mbed-os/hal\trng_api.h:30:16: note: forward declaration of 'struct trng_s' typedef struct trng_s trng_t; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:171:10: warning: implicit declaration of function '__HAL_RNG_GET_FLAG' is invalid in C99 [-Wimplicit-function-declaration] if ((__HAL_RNG_GET_FLAG(&obj->handle, (RNG_FLAG_CECS | RNG_FLAG_SECS))) != 0) { ^ .\mbed-os\targets\TARGET_STM\trng_api.c:171:33: error: incomplete definition of type 'struct trng_s' if ((__HAL_RNG_GET_FLAG(&obj->handle, (RNG_FLAG_CECS | RNG_FLAG_SECS))) != 0) { ~~~^ ./mbed-os/hal\trng_api.h:30:16: note: forward declaration of 'struct trng_s' typedef struct trng_s trng_t; ^ .\mbed-os\targets\TARGET_STM\trng_api.c:171:44: error: use of undeclared identifier 'RNG_FLAG_CECS' if ((__HAL_RNG_GET_FLAG(&obj->handle, (RNG_FLAG_CECS | RNG_FLAG_SECS))) != 0) { ^ .\mbed-os\targets\TARGET_STM\trng_api.c:171:60: error: use of undeclared identifier 'RNG_FLAG_SECS' if ((__HAL_RNG_GET_FLAG(&obj->handle, (RNG_FLAG_CECS | RNG_FLAG_SECS))) != 0) { ^ 6 warnings and 15 errors generated.

edit, working great on the skr2 so far, thanks

Please Log in to join the conversation.

More
5 years 1 week ago #224035 by scotta
Hi, This is a good test of the rebased code in Remora 1.0.0_rc. I've added a new TARGET_OCTOPUS and it has compiled successfully.

As I don't have this board, can you please check? Source is in the develop branch.

github.com/scottalford75/Remora/tree/dev.../FirmwareBin/OCTOPUS

Note: Serial comms for this target is on the Raspberry Pi header J26 with TX / RX on PD_5 and PD_6 respectively.

Please Log in to join the conversation.

More
5 years 1 week ago #224050 by cakeslob

Hi, This is a good test of the rebased code in Remora 1.0.0_rc. I've added a new TARGET_OCTOPUS and it has compiled successfully.

As I don't have this board, can you please check? Source is in the develop branch.

github.com/scottalford75/Remora/tree/dev.../FirmwareBin/OCTOPUS

Note: Serial comms for this target is on the Raspberry Pi header J26 with TX / RX on PD_5 and PD_6 respectively.

wow that was fast. yeah the rpi header is on pd_5 and 6 but for simplicity with the jst connector being 1 way(and discrepancy in their silkscreen on other revisions), and existing codebase I figured using the tft connector on j70 would be better (I also made cables with the jst 5 pin connector) but I can work with what ever. That was why I was asking about the machine power earlier for this board specifically.
Awesome stuff, thank you I will check this out tonight.

Please Log in to join the conversation.

More
5 years 1 week ago #224065 by cakeslob
DOesnt come out of estop and noting in the terminal

In the marlin ini file for stm32f4, the octopus doesnt have a bootloader offset
Code:
# BigTreeTech BTT002 V1.0 (STM32F407VGT6 ARM Cortex-M4) # [env:BIGTREE_BTT002] platform = ${common_stm32.platform} extends = common_stm32 board = marlin_BigTree_BTT002 build_flags = ${common_stm32.build_flags} -DSTM32F407_5VX -DVECT_TAB_OFFSET=0x8000 -DHAVE_HWSERIAL2 -DHAVE_HWSERIAL3 -DPIN_SERIAL2_RX=PD_6 -DPIN_SERIAL2_TX=PD_5 extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py # # BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_SKR_2] platform = ${common_stm32.platform} platform_packages = ${stm_flash_drive.platform_packages} extends = common_stm32 board = marlin_STM32F407VGT6_CCM board_build.core = stm32 board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/stm32_bootloader.py build_flags = ${stm_flash_drive.build_flags} -DUSE_USBHOST_HS -DUSE_USB_HS_IN_FS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED # # BigTreeTech Octopus V1.0/1.1 (STM32F446ZET6 ARM Cortex-M4) # [env:BIGTREE_OCTOPUS_V1] platform = ${common_stm32.platform} extends = common_stm32 board = marlin_BigTree_Octopus_v1 extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py build_flags = ${common_stm32.build_flags} -DSTM32F446_5VX -DVECT_TAB_OFFSET=0x8000 -DUSE_USB_HS_IN_FS # # BigTreeTech Octopus V1.0/1.1 (STM32F446ZET6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_OCTOPUS_V1_USB] extends = env:BIGTREE_OCTOPUS_V1 platform_packages = ${stm_flash_drive.platform_packages} #build_unflags = -DUSBCON -DUSBD_USE_CDC build_flags = ${stm_flash_drive.build_flags} -DSTM32F446_5VX -DVECT_TAB_OFFSET=0x8000 -DUSBCON -DUSE_USBHOST_HS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 -DUSE_USB_HS_IN_FS -DUSBD_USE_CDC_MSC

do i just remove the bootlaoderoffset from custom targets?
I cant get the main repos to compile for all 3 targets , only the stm32 repo i can get to compile the skr2

Please Log in to join the conversation.

More
5 years 1 week ago #224081 by gtt38
i'm afraid that your board is a STM32F446@180mhz
The SKR2 have a STM32F407@168mhz, so it's not the same chip and same clock configuration. you need to create your own version to support this chip.
 

Attachment not found




only 407 and 405 are supported
i need to test 415 and 417 series it could work
 

Please Log in to join the conversation.

More
5 years 6 days ago #224114 by cakeslob
scott did an update for a custom 446 target in the dev branch

Code:
[Fatal Error] iomacros.h@27,10: 'LPC17xx.h' file not found [ERROR] In file included from .\MODDMA\MODDMA.cpp:22: ./MODDMA/iomacros.h:27:10: fatal error: 'LPC17xx.h' file not found #include "LPC17xx.h"

I get this error when I try to compile for skrv2 or octopus targets on both branches. Compiling for SKRv2-os5 repo worked fine. Any suggestions?

Please Log in to join the conversation.

More
5 years 6 days ago #224123 by scotta
Hi cakeslob, 

The Octopus v1.1 does have the bootloader offset "-DVECT_TAB_OFFSET=0x8000" in the Marlin ini file. These are correct and the starting address as per the Bigtreetech bootloader info summary.

Not sure what's going on with your build environment as selecting the OCTOPUS or SKRV2 target should not be looking inside the SKRV1_4 target directory, this is why the Mbed build system is handy. Are you using Mbed Studio or CLI?

The repo is an image of my build environment (less mbed-os) so strange it's not working....

Please Log in to join the conversation.

More
5 years 6 days ago #224124 by Bari
 

Attachment not found


STM32F Discovery dev board uses the same part # STM32F407VGT6 as the SKR V2

Please Log in to join the conversation.

Time to create page: 0.214 seconds
Powered by Kunena Forum