peripherals in cores

Cores are the underlying magic that make the Arduino API possible
turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

peripherals in cores

Post by turboscrew » Sun Dec 24, 2017 8:54 am

Where can I find out the devices and GPIO-pins used by the cores?
I'm using blue pill, and I'd like to know what resources does Serial.Println() use. Does it use DMA as FIFO?
Also on my blue pill SPI1 NSS doesn't work - it doesn't go high when the SPI is disabled - well, it does, but a lot later, so the default NSS-pin can't be used at all. (Haven't tried the other SPIs.)

stevestrong
Posts: 2057
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: peripherals in cores

Post by stevestrong » Sun Dec 24, 2017 10:17 am

Arduino_STM32 core
Serial is mapped to USB serial interface, if you have enabled -DSERIAL_USB in the boards.txt.
Otherwise serial is mapped to USART 1 interface, which uses PA9/10.
None of the serial interfaces uses DMA.

The NSS pin has to be controlled by the user:

Code: Select all

#define NSS_PIN PA4 // you can use any other available pin
...
pinMode(NSS_PIN, OUTPUT);
digitalWrite(NSS_PIN, HIGH); // deactivate slave select
...
If none of these information helped, do you have a simple sketch which can reproduce your problem?

turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: peripherals in cores

Post by turboscrew » Sun Dec 24, 2017 10:49 am

My "problem" is more like trying to get RFM69 library to work, and that includes having the right wires to right pins.
There are also serial prints, that I'd wish to get to my development computer terminal.

I'd also just like to know where to find the definitions, if I use some other libraries in the future, so my question is kind of generic.

Also, if there is:

Code: Select all

genericSTM32F103C.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
Does it mean that only USB-serial is used, or can I upload with ST-LINK-V2 and use USB-serial cable between my computer and the board?
Last edited by turboscrew on Sun Dec 24, 2017 11:18 am, edited 1 time in total.


turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: peripherals in cores

Post by turboscrew » Sun Dec 24, 2017 11:20 am

Thanks! That helps.

stevestrong
Posts: 2057
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: peripherals in cores

Post by stevestrong » Sun Dec 24, 2017 11:30 am

turboscrew wrote:
Sun Dec 24, 2017 10:49 am

Code: Select all

genericSTM32F103C.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
Does it mean that only USB-serial is used, or can I upload with ST-LINK-V2 and use USB-serial cable between my computer and the board?
Yes, USB serial is enabled, so you can output data to PC over USB cable.
And yes, you can upload with STLink (although pressing the reset button may be necessary).

turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: peripherals in cores

Post by turboscrew » Sun Dec 24, 2017 11:34 am

Went a bit further and found this: https://github.com/rogerclarkmelbourne/ ... rd/board.h
This seems to go a long way. It also suggests, that SysTick is used as a "main clock".

turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: peripherals in cores

Post by turboscrew » Sun Dec 24, 2017 11:36 am

stevestrong wrote:
Sun Dec 24, 2017 11:30 am
turboscrew wrote:
Sun Dec 24, 2017 10:49 am

Code: Select all

genericSTM32F103C.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
Does it mean that only USB-serial is used, or can I upload with ST-LINK-V2 and use USB-serial cable between my computer and the board?
Yes, USB serial is enabled, so you can output data to PC over USB cable.
And yes, you can upload with STLink (although pressing the reset button may be necessary).
I wonder if you can have serial output while debugging via ST-LINK...?

stevestrong
Posts: 2057
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: peripherals in cores

Post by stevestrong » Sun Dec 24, 2017 11:40 am

turboscrew wrote:
Sun Dec 24, 2017 11:36 am
I wonder if you can have serial output while debugging via ST-LINK...?
No, see here: viewtopic.php?f=35&t=3018

turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: peripherals in cores

Post by turboscrew » Sun Dec 24, 2017 11:54 am

I was wondering if ST-LINK was kept as a debug interface and USART1 could easily been configured as 'Serial'...

Uh, I guess I just need to remove the "USB_SERIAL" and use, say, Eclipse/OpenOCD for uploading and debugging via ST-LINK?

Post Reply