Skip to content

Clock does not start on STM32F373-Board #743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
michsens opened this issue Oct 30, 2019 · 12 comments
Closed

Clock does not start on STM32F373-Board #743

michsens opened this issue Oct 30, 2019 · 12 comments
Labels
answered question ❓ Usually converted as a discussion

Comments

@michsens
Copy link

Hello,

I developed a pcb with a STM32F373 in a LQFP-64 package. Programming is no big deal as long as I use TrueStudio. Clock configuration works well. Same for adc, dac, gpio input and output. Other modules I did not test. My aim was to see if the board itself works. It does.

The next step was to bring this board into the arduino environment. I defined the new board in the board file and created a folder with the variant, the ldscript, the PeripheralPins and PinNamesVAr files. I made I test with the well known Blink example. The compilation itself is successful, same with the upload.

But the controller does not start working. The 8MHz crystal does not start to operate what leads to a completely not working device.

I compared the libraries used by TrueStudio and arduino. I could not find anything suspicious. I also tried different versions of the stm32 cores (1.6.0, 1.6.1, 1.7.0) - no success.

What else can I observe to get the board working.

Regards

Robert.

@fpistm
Copy link
Member

fpistm commented Oct 30, 2019

Hi @michsens
this could comes from several reasons.
Could you share your variant then I could have a look and helps also for your other issue #742

@fpistm
Copy link
Member

fpistm commented Oct 30, 2019

Thanks but could you make an archive of the directory and attach it to this PR. Then I will have all files (PeripheralPins.c, PinNamesVar.h, ldscript.ld, variant.cpp, variant.h) and also boards.txt change you made.

@fpistm
Copy link
Member

fpistm commented Oct 30, 2019

Could you also precise which core version you used ? (or maybe the git repository?)
Host OS?
Thanks in advance

@michsens
Copy link
Author

Core Version 1.6.1

I also tried 1.7.0. But there was no difference.

@michsens
Copy link
Author

@fpistm fpistm added the question ❓ Usually converted as a discussion label Oct 30, 2019
@stm32duino stm32duino deleted a comment from michsens Oct 30, 2019
@fpistm
Copy link
Member

fpistm commented Oct 30, 2019

Thanks.
This is more easy to review.
Well they are several issue. The main one is the _estack definition in the linker script which I guess
avoid your board to boot.
Here all the fixes:
https://github.com/fpistm/Arduino_Core_STM32/tree/Example_STM32F373R8

Example_STM32F373R8.zip

@michsens
Copy link
Author

Thanks a lot for your help.

I have some question about the change in the PeripheralPins.c:
Why do you call the SDADC by HAL_SD_MODULE_ENABLED? In the stm32 libraries it is defined as HAL_SDADC_MODULE_ENABLED https://github.com/fpistm/Arduino_Core_STM32/blob/Example_STM32F373R8/system/STM32F3xx/stm32f3xx_hal_conf_default.h ?

It also confuses me, why you activate a PULLUP for each channel. I would change the lines as follows:

from: {PB_0, SDADC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF_NONE)}, // SDADC1_AIN6P

to: {PB_0, SDADC1,STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, SDADC1_AIN6P, 0)},

Would you agree? Do I missunderstand somethings?

@fpistm
Copy link
Member

fpistm commented Oct 31, 2019

This is a mistake.
The core doesn't manage SDADC.
I have to update the script which generate the PeripheralPins.c to handle this properly.

@fpistm
Copy link
Member

fpistm commented Oct 31, 2019

@michsens
is it ok now? Your board starts properly?

@fpistm fpistm added the waiting feedback Further information is required label Oct 31, 2019
@michsens
Copy link
Author

I am home today. I check it tomorrow when I am in the lab. I give you some feedback then. Thanks until here.

@michsens
Copy link
Author

michsens commented Nov 1, 2019

Good Morning,

the change in the ldscript was the key. The oscillator starts properly and the LED blinks now. Many thanks fpistm.

@fpistm fpistm added answered and removed waiting feedback Further information is required labels Nov 1, 2019
@fpistm
Copy link
Member

fpistm commented Nov 1, 2019

Welcome

@fpistm fpistm closed this as completed Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered question ❓ Usually converted as a discussion
Projects
None yet
Development

No branches or pull requests

2 participants