Closed Bamelink closed 2 years ago
Is there anything more I need to do? We do not have UART or USB on this board, so console output is hard, but going though the debugger after reset gives the output I have put below. I think it crashes in the init before main even runs. At least it interrupts and goes into a idle loop.
If you have a segger, you can enable the RTT log/shell backend and use that. Without a UART to display logs, you're going to be playing pin the tale on the 18km2 donkey. You can take the existing network samples, https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/sockets and try those on your board to see if networking is working. Then, if it does, use those prj.conf files as a base for your prj.conf file
Has someone got an example for using ethernet/UDP on STM32 MCU?.
Description
Hi, I am working on a project for Formula Student and I would like to use and push Zephyr with MicroROS. But I am currently stuck on getting ethernet up and running. We have made a custom board around the STM32F407VGT6, but it is very similar to the olimex_stm32_e407 and I can already flash some examples with this board by modifying it's configuration.
What I am not able to achieve is getting ethernet to work with Zephyr. We had our custom ehternet driver in FreeRTOS (which to this point could only send) so we know that it works on this board. I am fairly new to Zephyr and I think my problem lies in the prj.conf.
Has someone got an example?
My question is, whether someone has got an example for the configuration? I have my mac node in the dts with the according pins. I tried some examples like the net/socket/echo sample and added the following to the prj.conf: CONFIG_ETH_STM32_HAL=y CONFIG_NET_L2_ETHERNET=y Is there anything more I need to do? We do not have UART or USB on this board, so console output is hard, but going though the debugger after reset gives the output I have put below. I think it crashes in the init before main even runs. At least it interrupts and goes into a idle loop. As I said, things like blinky etc. work.
Additional context (Debugger output)
target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08002e0c msp: 0x20005a30 Start address 0x08002e0c, load size 79244 Transfer rate: 22 KB/sec, 3301 bytes/write. (gdb) s Info : halted: PC: 0x08002e0e halted: PC: 0x08002e0e 114 msr BASEPRI, r0 (gdb) Info : halted: PC: 0x08002e12 halted: PC: 0x08002e12 143 ldr r0, =z_interrupt_stacks (gdb) Info : halted: PC: 0x08002e14 halted: PC: 0x08002e14 144 ldr r1, =CONFIG_ISR_STACK_SIZE + MPU_GUARD_ALIGN_AND_SIZE (gdb) Info : halted: PC: 0x08002e18 halted: PC: 0x08002e18 145 adds r0, r0, r1 (gdb) Info : halted: PC: 0x08002e1a halted: PC: 0x08002e1a 146 msr PSP, r0 (gdb) Info : halted: PC: 0x08002e1e halted: PC: 0x08002e1e 147 mrs r0, CONTROL (gdb) Info : halted: PC: 0x08002e22 halted: PC: 0x08002e22 148 movs r1, #2 (gdb) Info : halted: PC: 0x08002e24 halted: PC: 0x08002e24 149 orrs r0, r1 / CONTROL_SPSEL_Msk / (gdb) Info : halted: PC: 0x08002e26 halted: PC: 0x08002e26 150 msr CONTROL, r0 (gdb) Info : halted: PC: 0x08002e2a halted: PC: 0x08002e2a z_arm_reset () at /home/wr/ascRemoteDocker/jan/asc/zephyr/arch/arm/core/aarch32/cortex_m/reset.S:156 156 isb (gdb) Info : halted: PC: 0x08002e2e halted: PC: 0x08002e2e 163 bl z_arm_prep_c (gdb) Info : halted: PC: 0x08002a24 halted: PC: 0x08002a24 z_arm_prep_c () at /home/wr/ascRemoteDocker/jan/asc/zephyr/arch/arm/core/aarch32/prep_c.c:250 250 relocate_vector_table(); (gdb) relocate_vector_table () at /home/wr/ascRemoteDocker/jan/asc/zephyr/arch/arm/core/aarch32/prep_c.c:250 250 relocate_vector_table(); (gdb) Info : halted: PC: 0x08002a26 halted: PC: 0x08002a26 Info : halted: PC: 0x08002a28 halted: PC: 0x08002a28 Info : halted: PC: 0x08002a2a halted: PC: 0x08002a2a Info : halted: PC: 0x08002a2e halted: PC: 0x08002a2e Info : halted: PC: 0x08002a30 halted: PC: 0x08002a30 52 DSB(); (gdb) DSB () at /home/wr/ascRemoteDocker/jan/asc/modules/hal/cmsis/CMSIS/Core/Include/cmsis_gcc.h:271 271 ASM volatile ("dsb 0xF":::"memory"); (gdb) Info : halted: PC: 0x08002a34 halted: PC: 0x08002a34 relocate_vector_table () at /home/wr/ascRemoteDocker/jan/asc/zephyr/arch/arm/core/aarch32/prep_c.c:53 53 ISB(); (gdb) ISB () at /home/wr/ascRemoteDocker/jan/asc/modules/hal/cmsis/CMSIS/Core/Include/cmsis_gcc.h:260 260 ASM volatile ("isb 0xF":::"memory"); (gdb) Info : halted: PC: 0x08002a38 halted: PC: 0x08002a38 z_arm_prep_c () at /home/wr/ascRemoteDocker/jan/asc/zephyr/arch/arm/core/aarch32/prep_c.c:252 252 z_arm_floating_point_init(); (gdb) z_arm_floating_point_init () at /home/wr/ascRemoteDocker/jan/asc/zephyr/arch/arm/core/aarch32/prep_c.c:252 252 z_arm_floating_point_init(); (gdb) Info : halted: PC: 0x08002a3c halted: PC: 0x08002a3c Info : halted: PC: 0x08002a40 halted: PC: 0x08002a40 Info : halted: PC: 0x08002a44 halted: PC: 0x08002a44 181 set_CONTROL(__get_CONTROL() & (~(CONTROL_FPCA_Msk))); (gdb) get_CONTROL () at /home/wr/ascRemoteDocker/jan/asc/modules/hal/cmsis/CMSIS/Core/Include/cmsis_gcc.h:975 975 ASM volatile ("MRS %0, control" : "=r" (result) ); (gdb) Info : halted: PC: 0x08002a48 halted: PC: 0x08002a48 z_arm_floating_point_init () at /home/wr/ascRemoteDocker/jan/asc/modules/hal/cmsis/CMSIS/Core/Include/cmsis_gcc.h:1003 1003 ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); (gdb) Info : halted: PC: 0x08002a4c halted: PC: 0x08002a4c Info : halted: PC: 0x08002a50 halted: PC: 0x08002a50 set_CONTROL (control=2) at /home/wr/ascRemoteDocker/jan/asc/modules/hal/cmsis/CMSIS/Core/Include/cmsis_gcc.h:1004 1004 ISB(); (gdb) ISB () at /home/wr/ascRemoteDocker/jan/asc/modules/hal/cmsis/CMSIS/Core/Include/cmsis_gcc.h:1004 1004 ISB(); (gdb) Info : halted: PC: 0x08002a54 halted: PC: 0x08002a54 z_arm_prep_c () at /home/wr/ascRemoteDocker/jan/asc/zephyr/arch/arm/core/aarch32/prep_c.c:254 254 z_bss_zero(); (gdb) Info : halted: PC: 0x08008590 halted: PC: 0x08008590 z_bss_zero () at /home/wr/ascRemoteDocker/jan/asc/zephyr/kernel/init.c:112 112 z_early_memset(bss_start, 0, __bss_end - bss_start); (gdb) Info : halted: PC: 0x08008592 halted: PC: 0x08008592 Info : halted: PC: 0x08008594 halted: PC: 0x08008594 Info : halted: PC: 0x08008596 halted: PC: 0x08008596 Info : halted: PC: 0x08008598 halted: PC: 0x08008598 Info : halted: PC: 0x0800859a halted: PC: 0x0800859a Info : halted: PC: 0x08010b5c halted: PC: 0x08010b5c z_early_memset (dst=0x20000c00, c=0, n=15260) at /home/wr/ascRemoteDocker/jan/asc/zephyr/kernel/init.c:88
88 (void) memset(dst, c, n);
(gdb)
__memset_ichk (len=15260, src=0, dst=0x20000c00 ) at /home/wr/zephyr-sdk-0.14.2/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/ssp/string.h:86
86 __ssp_bos_icheck3(memset, void *, int)
(gdb)
Info : halted: PC: 0x080115fe
halted: PC: 0x080115fe
Note: automatically using hardware breakpoints for read-only addresses.
Info : halted: PC: 0x08011588
halted: PC: 0x08011588
Info : halted: PC: 0x08011588
halted: PC: 0x08011588
Info : halted: PC: 0x08011588
halted: PC: 0x08011588
^C Program received signal SIGINT, Interrupt. arch_cpu_idle () at /home/wr/ascRemoteDocker/jan/asc/zephyr/arch/arm/core/aarch32/cpu_idle.S:105 105 cpsie i (gdb) Quit (gdb) q A debugging session is active.
Quit anyway? (y or n) y