STM32GENERIC, my arduino implementation

Cores are the underlying magic that make the Arduino API possible
michael_l
Posts: 318
Joined: Mon Aug 24, 2015 6:11 pm

Re: STM32GENERIC, my arduino implementation

Postby michael_l » Fri May 05, 2017 7:15 pm

ChrisMicro wrote:
L476RG ah then RAM LENGTH = 128K is wrong also.


@michael
Did you try my STM32F4 Discovery examples the microphone is working a little bit ...


Nice work! I'll have to check that.

User avatar
Pito
Posts: 994
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: STM32GENERIC, my arduino implementation

Postby Pito » Sun May 07, 2017 7:14 pm

While building for my BLUE F103ZE I get an error:

Code: Select all

C:\Users\pito\MyCode\Sloeber\SDBench_F1\Release\arduino.ar(stm32_gpio_af.c.o): In function `AF__HAL_AFIO_REMAP_SPI3_ENABLE':
C:/Users/pito/MyCode/Arduino/hardware/Arduino_STM32SerBuff/STM32DE/system/STM32F1/stm32_chip/stm32_STM32F103ZE.h:250: undefined reference to `__HAL_AFIO_REMAP_SPI3_ENABLE'
C:\Users\pito\MyCode\Sloeber\SDBench_F1\Release\arduino.ar(stm32_gpio_af.c.o): In function `AF__HAL_AFIO_REMAP_SPI3_DISABLE':
C:/Users/pito/MyCode/Arduino/hardware/Arduino_STM32SerBuff/STM32DE/system/STM32F1/stm32_chip/stm32_STM32F103ZE.h:249: undefined reference to `__HAL_AFIO_REMAP_SPI3_DISABLE'


Enclosed the BLUE F103 ZE variant:
BLUE_F103ZE.rar
(8.19 KiB) Downloaded 2 times


UPDATE: I've added into the file \system\STM32F1\HAL_Inc\stm32f1xx_hal_gpio_ex.h, line 512:

Code: Select all

#define AFIO_MAPR_SPI3_REMAP                 ((uint32_t)0x10000000)

such it compiles now, but I doubt it is the right way to do.. :)
Last edited by Pito on Mon May 08, 2017 8:03 am, edited 4 times in total.
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 994
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: STM32GENERIC, my arduino implementation

Postby Pito » Sun May 07, 2017 9:30 pm

This seems does not work here with F103 core (Serial or Serial1 or SeriaUART1) on PA9, PA10 :

Code: Select all

  while (!Serial.available()) {
     };


UPDATE - it is because the Serial RX does not work..
UPDATE1 - Serial RX works on F407
Pukao Hats Cleaning Services Ltd.

victor_pv
Posts: 1248
Joined: Mon Apr 27, 2015 12:12 pm

Re: STM32GENERIC, my arduino implementation

Postby victor_pv » Mon May 08, 2017 4:04 am

Pito wrote:This seems does not work here with F103 core (Serial or Serial1 or SeriaUART1) on PA9, PA10 :

Code: Select all

  while (!Serial.available()) {
     };


UPDATE - it is because the Serial RX does not work..
UPDATE1 - Serial RX works on F407


Is the core trying to use HW flow control? if it is that could conflict with the usb pins, and perhaps some function is returing with an error.

danieleff
Posts: 216
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: STM32GENERIC, my arduino implementation

Postby danieleff » Mon May 08, 2017 4:28 am

Pito wrote:This seems does not work here with F103 core (Serial or Serial1 or SeriaUART1) on PA9, PA10 :

Code: Select all

  while (!Serial.available()) {
     };


UPDATE - it is because the Serial RX does not work..
UPDATE1 - Serial RX works on F407

Hmm it does work on my maple mini.

User avatar
Pito
Posts: 994
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: STM32GENERIC, my arduino implementation

Postby Pito » Mon May 08, 2017 6:35 am

The receive does not work here with F103ZE, I do not have MapleMini handy now, but it did not not work with MM either.
Can you confirm you can enter data into MMini via SerialUART?
Pukao Hats Cleaning Services Ltd.

danieleff
Posts: 216
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: STM32GENERIC, my arduino implementation

Postby danieleff » Mon May 08, 2017 6:44 am

I only tried connecting rx-tx, then SerialUART1.write(5), if (SerialUART1.available()) {if (SerialUART1.read() == 5) {...}}
By the way, transmitting works? (both are implemented with interrupt ringbuffer)

User avatar
Pito
Posts: 994
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: STM32GENERIC, my arduino implementation

Postby Pito » Mon May 08, 2017 7:00 am

TX works as we can print the results of our experiments :)
The RX does not.. I will try with a demo..

Code: Select all

//#define Serial SerialUART1
//#define Serial Serial1

int incomingByte = 0;   // for incoming serial data
void setup() {
        Serial.begin(115200);
        Serial.println("Serial Demo, enter a char:");
}
void loop() {
        if (Serial.available() > 0) {
                incomingByte = Serial.read();
                Serial.print("I received: ");
                Serial.println(incomingByte, HEX);
        }
}

Nope with UART.. (BLUE F103ZE, PA9, PA10)

SerialUSB works:

Code: Select all

Serial Demo, enter a char:
I received: D
I received: A
I received: 68
I received: 6A
I received: 6B
I received: 6F
I received: 73

It works with Serial1 on libmaple F103ZE too..
Pukao Hats Cleaning Services Ltd.

danieleff
Posts: 216
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: STM32GENERIC, my arduino implementation

Postby danieleff » Mon May 08, 2017 5:55 pm

I think I found the fix for UART RX on F1, committed.

victor_pv
Posts: 1248
Joined: Mon Apr 27, 2015 12:12 pm

Re: STM32GENERIC, my arduino implementation

Postby victor_pv » Tue May 09, 2017 4:05 am

!Serial doesn't work for the USB, it's set to return always false, can we change it?
This seems ro work fine for me on F1:

Code: Select all

SerialUSBClass::operator bool()
{
   // this is here to avoid spurious opening after upload
   if (millis() < 500)
      return false;

   bool result = false;
   if(hUsbDeviceFS.dev_state == USBD_STATE_CONFIGURED){
      result = true;
   }
/*    if (_usbLineInfo.lineState > 0)
   {
      result = true;
   }

   delay(10); */
   return result;
}
Last edited by victor_pv on Tue May 09, 2017 9:41 pm, edited 1 time in total.


Return to “Cores”

Who is online

Users browsing this forum: No registered users and 1 guest