Skip to content
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

Core Board F401RC #604

Merged
merged 1 commit into from
Aug 28, 2019
Merged

Core Board F401RC #604

merged 1 commit into from
Aug 28, 2019

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Aug 19, 2019

@fpistm fpistm self-assigned this Aug 19, 2019
@fpistm fpistm added this to In progress in STM32 core based on ST HAL via automation Aug 19, 2019
Copy link
Member Author

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic tests done by @mrguen.
Ready to merge

@fpistm fpistm added this to the 1.7.0 milestone Aug 26, 2019
Fixes stm32duino#594

Co-authored-by: Thierry GUENNOU <t_guennou@hotmail.com>
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
@fpistm fpistm merged commit 5bb50be into stm32duino:master Aug 28, 2019
STM32 core based on ST HAL automation moved this from In progress to Done Aug 28, 2019
@fpistm fpistm deleted the 594-CoreBoard_F401RC branch August 28, 2019 13:41
@mrguen
Copy link
Contributor

mrguen commented Aug 29, 2019

Sorry I tested only if analogRead() and digitalRead() on all ad hoc pins are ok. I would try to test the rest later if you mind.

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

@fpistm
Could you explain me more about the DFU and Serial download mode. Here is what I see

  1. Download using DFU on a board just attached to the USB port and seen as "STM32 bootloader" by windows. Download method STM32CubeProgrammer (DFU), Boot0 = 1

Works. Then the device COM port is enumerated. Then DFU download is not possible anymore and results in

"Error: Target device not found - Establishing connection with the device failed"

  1. Ok, so I try to download using STM32CubeProgrammer (Serial) / seleting the COM port . The device is seen as "STM Serial" by windows. Tested Either in BOOT0 = 0 or BOOT0=1 results in:
"Serial Port COM29 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
                     stop-bit = 1.0, flow-control = off

Timeout error occured while waiting for acknowledgement.

Timeout error occured while waiting for acknowledgement.
Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... "
  1. So at the moment the only solution is to set BOOT0 = 1 and reset the device everytime so it is seen as a DFU device and not enumerated as a Serial device.

@fpistm
Copy link
Member Author

fpistm commented Aug 30, 2019

@mrguen
all is explained in this document:
https://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

image

So timeout you get in for serial upload is due to no ack from the board about the 0x7F. You have to reset the board then it will acknowledge properly.
For DFU yes you have to reset it to switch to DFU mode.

I've planned to add an automatic reset in bootloader mode thanks a special sequences on the Serial line as it is done for HID BL or Maple DFU BL.

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

Either I manual reset or not it will not upload using STM32CubeProgrammer (Serial) (BOOT0=0).

There is no delay before printing the error... there is no time for scanning a device (and pressing the switch). The device is enumerated in Windows "STM Serial (COM29)"

Now it raises:
"Error: Cannot open port COM29, it may be used by another application or port name is invalid."

@fpistm
Copy link
Member Author

fpistm commented Aug 30, 2019

This is not related to the core.
It is a STM32CubeProgrammer/STM32 Bootloader usage.
I guess you should ask on ST community.

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

Ok, I will continue testing the device uploading with reset / DFU because it is way over my head and I would like to finish this.

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

So far I could not validate these tests:

Serial 6 on PC7/PC6: not working (Serial 1 and 2 ok)
I2C1 on PB7/PB6: not working (I2C2 ok): maybe related to issue #463 ?

@fpistm
Copy link
Member Author

fpistm commented Aug 30, 2019

PB3/PB10 is only I2C2.
How do you test USART6? Sketch?

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

Sorry my comment was false. I tested I2C1 on PB7/PB6. I just modified my comment.

I tested Serial 6 with SerialCallResponse.ino modified with instantiating
HardwareSerial SerialN6(PC7, PC6);

@fpistm
Copy link
Member Author

fpistm commented Aug 30, 2019

Well I guess you do not pay attention to pin mapping, SerialCallResponse set the pin number 2 in INPUTpinMode(2, INPUT); // digital sensor is on digital pin 2
and digital pin number 2 is... PC6 so I guess this could cause some trouble to rest USART6 TX pin to INPUT...

And how do you test I2C1 on PB7/PB6

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

Ok, thanks. Serial 6 is working.

I2C works when instantiating TwoWire Wire1(PB7, PB6); but not with the default Wire instance.

So variant.h should have
// I2C Definitions
#define PIN_WIRE_SDA PB7
#define PIN_WIRE_SCL PB6

@fpistm
Copy link
Member Author

fpistm commented Aug 30, 2019

Which is normal as the default Wire instance is on PB8 (SDA) / PB9 (SCL)...
To change the default pins used by the default instance see:
https://github.com/stm32duino/wiki/wiki/API#i2c

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

Ok, so these tests passed:

  • Blink
  • Serial through USB
  • Serial1 PA9/PA10
  • Serial 2 PA2/PA3
  • Serial 6 PC7/PC6
  • I2C1 PB9/PB8
  • I2C2 PB3/PB10
  • AnalogReadSerial - all adc pins
  • DigitalReadSerial - all digital pins
  • Watchdog timer
  • SPI1 with a 0.96" TFT Display

I could not write to EEPROM (eeprom_write.ino) the value '100' and then read it (eeprom_read.ino). It constantly reads 255.

@fpistm
Copy link
Member Author

fpistm commented Aug 30, 2019

Thanks for the tests.
Try eeprom_put/get instead.

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

Yes, passed:

  • eeprom_put
  • eeprom_get

I suppose eeprom_write and eeprom_read have a datatype problem but won't investigate it.

@mrguen
Copy link
Contributor

mrguen commented Aug 30, 2019

@fpistm Thanks for your constant support.

matthijskooijman added a commit to matthijskooijman/STM32-base.github.io that referenced this pull request Apr 28, 2020
These were taken from
stm32duino/Arduino_Core_STM32#604. It is not
entirely clear where they originally came from (there is an aliexpress
link, which has an image with the dimensions but no PDF and no
schematics).
matthijskooijman added a commit to matthijskooijman/STM32-base.github.io that referenced this pull request Apr 29, 2020
These were taken from
stm32duino/Arduino_Core_STM32#604. It is not
entirely clear where they originally came from (there is an aliexpress
link, which has an image with the dimensions but no PDF and no
schematics).
ThomasGravekamp pushed a commit to STM32-base/STM32-base.github.io that referenced this pull request Apr 29, 2020
These were taken from
stm32duino/Arduino_Core_STM32#604. It is not
entirely clear where they originally came from (there is an aliexpress
link, which has an image with the dimensions but no PDF and no
schematics).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

[New Variant]STM32F401
2 participants