DanielMartensson / STM32-PLC

STM32 microcontroller with lots of periferials such as ADC, differential ADC, Input Capture, PWM, USB, Encoder, DAC, Digital Input, RTC, CAN-bus + Alarm etc.
MIT License
99 stars 43 forks source link

STM32 reference direction #7

Closed MrHorizonPy closed 6 months ago

MrHorizonPy commented 6 months ago

Can you tell me if the controller is correctly installed on the board? After loading the .ico file, only the backlight comes on at the display, the LEDs don't light up, but it seems that the loading went correctly. I attach some photos. Image (1) Image (2)

Thanks you.

DanielMartensson commented 6 months ago

Does your LSE working ? Try to run Debug mode

@MrHorizonPy

MrHorizonPy commented 6 months ago

Yes it seems to be working, this is another error it gives me: IMG-20240326-WA0004

DanielMartensson commented 6 months ago

@MrHorizonPy so it stops at HAL_init()?

MrHorizonPy commented 6 months ago

yes

DanielMartensson commented 6 months ago

yes

@MrHorizonPy at what line? It seems you're having a software issue rather than hardware issue.

Can you investigate more ? I can help.

MrHorizonPy commented 6 months ago

What do you need to know?

DanielMartensson commented 6 months ago

What do you need to know?

@MrHorizonPy everything. What is the code that cause issues. What's the error message?

MrHorizonPy commented 6 months ago

GNU gdb (GNU Tools for STM32 11.3.rel1.20230912-1600) 12.1.90.20220802-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=x86_64-w64-mingw32 --target=arm-none-eabi". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.

For help, type "help". Type "apropos word" to search for commands related to "word".

set (int )0xE000EDFC=(int )0xE000EDFC|0x7F0

Temporary breakpoint 1, main () at ../Core/Src/main.c:125 125 HAL_Init();

MrHorizonPy commented 6 months ago

image

MrHorizonPy commented 6 months ago

This is the error it gives me

DanielMartensson commented 6 months ago

@MrHorizonPy Can you step inside the HAL_Init(); function? Use the "step-inside" button image

Try this: https://community.st.com/t5/stm32cubeide-mcus/program-randomly-pauses-and-refuses-to-run-after-handle-vcont-t/m-p/247904

MrHorizonPy commented 6 months ago

Hi @DanielMartensson I tried as you told me but it is since yesterday stuck in running and not going on

DanielMartensson commented 6 months ago

@MrHorizonPy

So at which line does it stop? Inside HAL_init() function.

MrHorizonPy commented 6 months ago

yes

DanielMartensson commented 6 months ago

yes

@MrHorizonPy and? More information...which code line ?

MrHorizonPy commented 6 months ago

the error is always the same, I am probably doing something wrong or I don't have some library installed. Mica you can provide me with some more information?

DanielMartensson commented 6 months ago

the error is always the same, I am probably doing something wrong or I don't have some library installed. Mica you can provide me with some more information?

@MrHorizonPy It seems that you having more errors?

Yes, you're probably flashing it wrong.

Post the total build output and debug output

image

MrHorizonPy commented 6 months ago

image Hi @DanielMartensson , I am sending you the photo with the error message. It`s still the same as the previous one, once I baipass the error as you told me the test stays stuck running without ever becoming complete. I am sending you the full text of the debug console: GNU gdb (GNU Tools for STM32 12.3.rel1.20240306-1730) 13.2.90.20230627-git Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=x86_64-w64-mingw32 --target=arm-none-eabi". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.

For help, type "help". Type "apropos word" to search for commands related to "word".

set (int )0xE000EDFC=(int )0xE000EDFC|0x7F0

Temporary breakpoint 1, main () at ../Core/Src/main.c:124 124 HAL_Init();

DanielMartensson commented 6 months ago

@MrHorizonPy

Have you created the temporary breakpoint in the code?

So you cannot step inside the HAL_init(); function during debug? Once you came to HAL_init(); your debugging freeze or what?

This sounds like an IDE-issure, rather than software issue.

Can you try to deactivate the LSE-clock?

If there are some bad soldering, then LSE-clock might not start...then the issue will occour like yours.

MrHorizonPy commented 6 months ago

Hi, Yes I created a temporary breakpoint, debugging continues but remains running without ever completing or giving any other errors. How do I disable the LSE clock? The soldering seems to be all correct I also measured the voltages based on the PCB you drew. My only doubt at first was about the direction of the STM32 as it has 2 reference dots

DanielMartensson commented 6 months ago

Hi, Yes I created a temporary breakpoint, debugging continues but remains running without ever completing or giving any other errors. How do I disable the LSE clock? The soldering seems to be all correct I also measured the voltages based on the PCB you drew. My only doubt at first was about the direction of the STM32 as it has 2 reference dots

Sorry for late response. I'm at holiday in the mountains and driving snowmobile.

So if your basic project works fine without errors, then it seems that there is something with the clocks, I guess. Even if your solderings are correct, it might have some flux left or contamination.

You can disable the LSE clock at the RCC in STM32CubeIDE. Just set it as disable.

I'm sure that your PCB board will work. We need just to find a solution.