Continued issues with WeAct STM32F411

MGeo
Posts: 24
Joined: Thu Dec 19, 2019 10:29 am

Continued issues with WeAct STM32F411

Post by MGeo »

I see this board presents challenges. With v1.9.0 core, Blink sketch and upload via J-Link SWD I have problems with board immediately losing the SWD connection and I am unable to debug. After that I am unable to connect to the board over SWD with or without hardware reset. I have to fully erase the chip via DFU to bring the board back to a working state. I am running the board bare, no bootloader of any sort.

I've reviewed this closed issue https://github.com/stm32duino/Arduino_C ... issues/876 my issues look similar.

Using the variant files from this comment https://github.com/stm32duino/Arduino_C ... -577418051 with a dedicated PILL_F411XX variant resolves the issue but I've not traced the root cause as of yet.

I realize this board unfortunately has a 25MHz oscillator on HSE rather than 8MHz. Are there any special instructions to use this board with v1.9.0 core?

.rpv
Posts: 28
Joined: Wed Dec 18, 2019 10:19 pm

Re: Continued issues with WeAct STM32F411

Post by .rpv »

I made a "black pill" with the F411CEU and duplicating the variant since it wasn't clear what HSE clock was the variant using... just overwriting the .id file and the clock config function (my board uses an 8MHz crystal) for what the stm32cubeide creates and I didn't have any problem so far with my blackpill version.

User avatar
fpiSTM
Posts: 746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Continued issues with WeAct STM32F411

Post by fpiSTM »

You can try to define HSE_VALUE to 25000000 thanks build_opt.h or hal_conf_extra.h

ddano007
Posts: 4
Joined: Mon Oct 05, 2020 9:08 am

Re: Continued issues with WeAct STM32F411

Post by ddano007 »

Hi, guys. I have BlackPill V3.0 STM32F411CEU6 board and want to use 16-pit PWM output.
When using pwmWrite() command I got
'pwmWrite' was not declared in this scope
message when compiling my sketch. Is there any way to have 16-bit PWM resolution for this board in Arduino IDE?
analogWriteResolution(16) + analogWrite() command still have only 12-bit resolution.
Thanks.

User avatar
fpiSTM
Posts: 746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Continued issues with WeAct STM32F411

Post by fpiSTM »

ddano007 wrote:
Mon Oct 05, 2020 9:19 am
'pwmWrite' was not declared in this scope
I guess you used the STM32 core while your code call specific API from Roger's one. So update your code to use proper API against the core you used.

ddano007
Posts: 4
Joined: Mon Oct 05, 2020 9:08 am

Re: Continued issues with WeAct STM32F411

Post by ddano007 »

fpiSTM wrote:
Mon Oct 05, 2020 9:36 am
I guess you used the STM32 core while your code call specific API from Roger's one. So update your code to use proper API against the core you used.
Yes, I`m using STM32 Cores. Is there any command for 16-bit PWM output?

User avatar
fpiSTM
Posts: 746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Continued issues with WeAct STM32F411

Post by fpiSTM »

https://www.arduino.cc/reference/en/lan ... esolution/

Code: Select all

analogWriteResolution(16);
analogWrite(PYn, value);

GonzoG
Posts: 47
Joined: Wed Jan 15, 2020 11:30 am
Answers: 4

Re: Continued issues with WeAct STM32F411

Post by GonzoG »

ddano007 wrote:
Mon Oct 05, 2020 9:19 am
...
analogWriteResolution(16) + analogWrite() command still have only 12-bit resolution.
...
I don't know why, by analogWrite resolution is limited to max ADC resolution.
wiring_analog.c

Code: Select all

void analogWriteResolution(int res)
{
  if ((res > 0) && (res <= 32)) {
    _writeResolution = res;
    if (_writeResolution > MAX_ADC_RESOLUTION) {
      _internalWriteResolution = MAX_ADC_RESOLUTION;
    } else {
      _internalWriteResolution = _writeResolution;
    }
  } else {
    Error_Handler();
  }
}
 

ddano007
Posts: 4
Joined: Mon Oct 05, 2020 9:08 am

Re: Continued issues with WeAct STM32F411

Post by ddano007 »

fpiSTM wrote:
Mon Oct 05, 2020 12:30 pm
https://www.arduino.cc/reference/en/lan ... esolution/

Code: Select all

analogWriteResolution(16);
analogWrite(PYn, value);
Thanks for tip, but analogWriteResolution(16) doesn`t work, it "remap" 16-bit to 12-bit resolution on my board... :cry:
( I hope, I`m not wrong, that STM32F411 is by HW capable of 16-bit PWM output... )

User avatar
fpiSTM
Posts: 746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Continued issues with WeAct STM32F411

Post by fpiSTM »

Else, You can use the HardwareTimer library:

https://github.com/stm32duino/wiki/wiki ... er-library

Post Reply

Return to “STM32F4 based boards”