I did. Seems to work.RogerClark wrote:Re: delay();
I'm not sure why we cant use the HAL_Delay() for delay() ? They are both in milliseconds.
I sort of got that impression too. I do not know what or how many things use uSec timing. My existing code polls on AVR timers, so that is always an option. The sam code has two versions on wiring.c I scrubbed one that seemed Atmel specific. the other was commented out and I left it in.I did a bit of background reading around microsecond timing using Sys Tick, but the basic HAL code wont be enough to do this, some specific timer callbacks will be needed.
To be honest I have not read a lot of Arduino/Processing code. So I do not really know what the advanced users do.
I'll take a look at that. There is quite a bit of serial examples in the ST stuff downloaded by CubeMX. I found the syscall.c file which I think hooks printf into the serial stream. At least that is what the example does. When I included one of the Arduino functions it wanted '_sbrk' I stubbed it out, but with the actual STM file it compile fine (syscall.c looks like it is part of a GCC distro.)BTW. I also found some code that looks like it would handle the serial comms
http://stackoverflow.com/questions/2487 ... hal-driver
I am quite rusty on C++ having most recently programmed postscript with some ObjectiveC (Was playing with swift before this project caught my attention. Actually I was working on making swift talk to one of my existing AVR boards. I probably should be working on the desktop UI, but this is so much more interesting at the moment. )
At the moment I am looking for where the Arduino sam code attaches the Hardware serial to the stream classes. This is done different to the way your changes to maple libs are coded.
Arduino sam does not seem to use HardwareSerial.c instead it creates it's own low level static library based on manufacture supplied code from Atmel. That looks to be pre compiled into a separate static library with make. I think Koduino does this also. If I search for serial1 it is part of USB. Serial_ seems to be defined in UART an inherited by USART. I noticed that the HAL documentation sometimes interchanges UART and USART.
That is what the HAL code seems to be doing. I am probably over thinking what is necessary.Re: GPIO Clock enable.
As its on a port by port basis, all I did in the bootloader is enabled all GPIO clock for all possible ports, A to E in the case of the F103, this didn't seem to cause any problems, so I suspect the same thing is possible in gpio.c (the Cube already wrote code enabling all the GPIO clocks even though I don't think in the pin GIO thing I was using all ports.