stm32duino / Arduino_Core_STM32

STM32 core support for Arduino
https://github.com/stm32duino/Arduino_Core_STM32/wiki
Other
2.84k stars 976 forks source link

SoftwareSerial hardware timer interrupt not being called? #919

Closed lab-mathias-claussen closed 4 years ago

lab-mathias-claussen commented 4 years ago

[Edit]: Problem fixed with current code from Git ( commit 1043594 )

STM32F072C8T6 / Elektor LoRa Node

Seems like #879 the interrupt for the hardware timer is not getting called. We can see that the IO Pins get configured ( PA2 and PA3 ) in this case.

To Reproduce:

Fit a STM32F072C8T6 on a bluepill and put the following code using version 1.8 of the core on the board:

/ Includes /

include <hal/hal.h>

include

include

include

include

SoftwareSerial SerialX(PA3, PA2); //RX, TX /**

  • Function : print_array
  • Description : will print an array of data as hex
  • Input : uint8_t * data , uint32_t len
  • Output : none
  • Remarks : none **/ void print_array(uint8_t * data , uint32_t len ){

    for(uint32_t i=0;i<len;i++){ Serial.print("0x"); Serial.print(*data++); Serial.print(" "); } Serial.println(""); }

void setup() { Serial.begin(115200); SerialX.begin(9600); Serial.println("Boot");

}

void loop() { SerialX.write(0xAA); while(SerialX.available() ){ Serial.write(SerialX.read()); } Serial.write(0x55);

}

What will be shown on USART 1 is:

Boot U

And at that Point the code seems to stop at all image

PA2 is TX and PA3 is RX for hardware serial output we use PA9 / PA10

Currently we try to investigate this further but stummbeled also accross some other issues that may lay down int the variant itself. The code works fine on a STM32F103 blue pill

stas2z commented 4 years ago

895

fpistm commented 4 years ago

Hi @lab-mathias-claussen

You can check the issue provided by @stas2z

Anyway about this:

Fit a STM32F072C8T6 on a bluepill

What would you mean by this ? You replaced the STM32F103 by a STM32F072C8T6 ? So this is a custom board? Which variant you used in this case?

lab-mathias-claussen commented 4 years ago

It uses the ELEKTOR_F072C8 variant, an we replaced the STM32F103 by a STM32F072C8T6. This is kind of a custom board for internal development to mimic the ELEKTOR_F072C8 variant.

image

lab-mathias-claussen commented 4 years ago

Fixed with current code from Git repository Thanks