Any project with STM32F072 core?

ekawahyu
Wed Apr 13, 2016 6:31 am
Glad to find this website! I am thinking to use STM32F072 for my project and would love to port Arduino onto it. Any pointer or existing project I should look into instead for writing it from scratch? Any tips on where to begin and what to avoid? Thank you.

RogerClark
Wed Apr 13, 2016 7:34 am
A few people (@sheepdoll and @vassilis) have been working on an alternative “core” using STM’s “Cube” software to generate the necessary files to support any processor that the “Cube” supports

See viewtopic.php?f=46&t=990

At the moment, the F072 is not one that has been exported from the Cube, and the files from the Cube need some modification (patching) before they can be used as an Arduino “core”, but this does theoretically make it easier to add new processors.

One big caveat is at the moment, this is at pre-alpha stage and only things like GPIO are working. Though I see today that Vassilis now has SPI working and tested on the F103

If you have a F072 device, perhaps you can volunteer to help with developing and testing of the new core on that processor.


ekawahyu
Wed Apr 13, 2016 11:17 pm
Thanks for the pointer. I just took a quick look at the code on github. Is there any reason why we don’t use bootloader for STM32? I will definitely build some code for this 072 core and I can help them with F0 core in general. Which core is more stabile for now and what board do you use? Just to get my hands quickly to some working platform and then move on to port 072.

RogerClark
Wed Apr 13, 2016 11:31 pm
I’ve not tried the bootloader on anything other than the F103, I’m not sure if it would work at all on the F072, but you could try it.

I suspect there will be some difference in the setup of the PLL’s and various other clocks etc etc that may prevent the F103 bootloader working on the F072

Re: HAL MX not using the bootloader

I think you are asking why the HAL MX core doesn’t use the bootloader

We’ve not got around to modifying the HAL MX core so that it will run at a different start address

Theoretically we just need to change the start vector to the address the bootloader jumps to 0x8002000 and the HAL MX core may work with the bootloader.

However the start vector is hard coded into one of the HAL headers, so we’d need to patch that header every time we do a re-export of the HAL files from the Cube.

We already need to patch main.c, so I suspect in the fullness of time, we’ll need to write a suite of patches as part of the core creating / regeneration process

However, no one has had time to work on the HAL MX core, and only recently @vassilis has been able to move things forward a bit (following on from @sheepdoll’s original work)


ekawahyu
Thu Apr 14, 2016 2:11 am
Got it! I will browse the forum and try to follow what they did first.

ekawahyu
Wed Apr 20, 2016 3:32 am
I have 20 exact same STM32F072C8 boards. I am running all of them with built-in internal oscillator. When I configure STM32Cube to include USB CDC, most of these boards fall into hard fault handler. But when I remove the USB CDC configuration, they are all running just fine. I wondered if this is due to instability in the USB CDC stack or did I miss something while configuring the clock for USB CDC mode? Has anyone with STM32Cube (any STM32 core and CDC stack) made it working and stable?

RogerClark
Wed Apr 20, 2016 3:36 am
See this thread

http://www.stm32duino.com/viewtopic.php?f=46&t=990

A few people are working on an Arduino “core” using the STM Cube. However only Vassilis has managed to make the USB Serial CDC work.

@sheepdoll has issues with the CDC on OSX.

I’ve not managed to get the Cube to export valid code after enabling the USB :-(


ekawahyu
Wed Apr 27, 2016 10:10 pm
Finally, I got the USB CDC to work and stable on STM32F072. At this point, it is very useful to get the printf() out of CDC ACM. As you said, I didn’t manage as well to generate the USB stack using STM32CubeMX. Something just did not want to work and it fell into Hardfault handler all the time. Do you know how to debug the call stack using OpenOCD? Or reviewing or monitoring (potentially) stack overflow?

I took the USB CDC example from FW1.5.0, which was used by STM32CubeMX for code generation. I just can’t understand why wouldn’t it work with the Cube if it work just fine in the examples provided by ST.

Next step is to clean up this USB CDC thing and adding a bootloader. Any pointer on the source code of bootloader that works for STM32 from your (or anyone else’s) repository?


RogerClark
Wed Apr 27, 2016 11:32 pm
The source code to the maple bootloader, which we use is in a repo in my github account, but it doesnt use the HAL or the SPL, its bare metal programming directly to the hardware

I suspect as the HAL etc generates large binaries, it may not be suitable to write a bootloader.

I know @jcw was writing a new bootloader, but I don’t think he ever finished

You could also look at libopencm3 as it has usb code.


ekawahyu
Thu Apr 28, 2016 3:51 am
As always, thanks for the quick turnaround time. I wrote bare metal bootloader for 8051, but that is an 8-bit core with limited space. So, size does matter. You maybe right about writing it baremetal to keep it small, but most of definitions (as far as I know) are not function calls in the standard peripheral library. I am going to check further on this. I’ll look at your repository first.

ekawahyu
Thu Apr 28, 2016 3:56 am
One question though, could you explain how Arduino IDE send the boot command over serial connection? Is it documented somewhere? Thanks.

RogerClark
Thu Apr 28, 2016 4:01 am
The code in the libmaple core and the tools developed by Leaflabs (who originally wrote it all), send a special sequence of characters and do something with DTR or one of the other serial control lines.
You will need to search in the repo core code if you want to find the sequence that the maple_upload tool sends

But this is not standard for the Arduino. I don’t know how its handled on an AVR arduino, you would need to post to the Arduino.cc forum to find out.


ekawahyu
Thu Apr 28, 2016 6:09 am
I just did a quick build for F103 board bootloader from your repository. I am aware of all those warnings in README. It does not seem to work for my F103 microcontroller compiled with GCC 4.7, 4.8, 5.2 at any optimization level. Too bad! I wanted to try first the DFU on F103 and port the code for F072!

RogerClark
Thu Apr 28, 2016 6:26 am
Last time I tried compiling it, it was OK

I just use gcc that comes with the Windows Arduino IDE, I think its arm-none-eabi-gcc\4.8.3-2014q1

But I’ve not tired to compile recently. However other people have compiled in the last day or two on OSX and not had any issues


ekawahyu
Thu Apr 28, 2016 6:39 am
Still no luck. I just downloaded the exact release of yours from here: http://forum.rfduino.com/index.php?topic=1142.0

ekawahyu
Sat Apr 30, 2016 4:54 pm
I managed to program Mini STM32 V2 with Arduino IDE (STM32F103RB). It was my bad, I forgot to connect the USB Disconnect pin to get enumerated.

Now that I got one platform to work to be used as reference, I can move forward to port the code to STM32F072. But before doing this, I have one remaining question. During the flash upload, is there a way to automate this instead of pressing DFU and reset buttons to enter flashing mode? I am sure you thought about this and I’d like to hear your ideas about it. Maybe I can help to make it happen.

I am still undecided yet whether I will go with DFU, CDC ACM with a serial bootloader.


ekawahyu
Sat May 14, 2016 7:35 am
I have done some of my homework :-), I guess I am closed to port Arduino to STM32F072. My updates are as follow:

  1. STM32CubeMX is a great tool to understand how to use STM32 HAL Driver by generating codes with various peripherals’ configuration. But, that’s it! Nothing works out of the box without a little touch here and there. So basically, I generated some code from it, and then copy and paste anything I need and move on with my own fix.
  2. I use STM32F0xx CMSIS V2.2.3 / 29-January-2016, STM32F0xx_HAL_Driver V1.3.1 / 29-January-2016, and STM32_USB_Device_Library V2.4.2 / 11-December-2015. I tried to include the latest libraries as I could. These releases work just fine for the moment.
  3. I use arm-none-eabi-gcc V5.2.1, not sure what version of GCC included within Arduino IDE 1.6.5? Which Arduino IDE should I use to test Arduino_STM32?
  4. My platform is STM32F072B-DISCO, which has STM32F072RBT6 chip on it and an on-board ST-Link V2/V2-1. There are something in the Makefile I need to get rid of, if we want to make the STM32F0xx HAL Driver to build for other F0xx variants (not a priority for now).
  5. I got the USB CDC ACM to work, with _write() and _read() function stubs. So, printf(), scanf(), and getchar() work just fine. I have also disable stdin, stdout, and stderr buffering. I would like to make getchar() as non-blocking, but I have no idea what to modify in the library. Anyone?
  6. A snippet from Hubert Denkmair (http://stackoverflow.com/questions/2828 … stm32-f072) is included in the system:

    #include <stdint.h>
    #include "stm32f0xx_hal.h"

    #define SYSMEM_RESET_VECTOR 0x1fffC804
    #define RESET_TO_BOOTLOADER_MAGIC_CODE 0xDEADBEEF
    #define BOOTLOADER_STACK_POINTER 0x20002250

    uint32_t dfu_reset_to_bootloader_magic;

    void __initialize_hardware_early(void)
    {
    if (dfu_reset_to_bootloader_magic == RESET_TO_BOOTLOADER_MAGIC_CODE) {
    void (*bootloader)(void) = (void (*)(void)) (*((uint32_t *) SYSMEM_RESET_VECTOR));
    dfu_reset_to_bootloader_magic = 0;
    __set_MSP(BOOTLOADER_STACK_POINTER);
    bootloader();
    while (42);
    } else {
    SystemInit();
    }
    }

    void dfu_run_bootloader()
    {
    dfu_reset_to_bootloader_magic = RESET_TO_BOOTLOADER_MAGIC_CODE;
    NVIC_SystemReset();
    }


RogerClark
Sat May 14, 2016 9:52 pm
See

http://www.stm32duino.com/viewtopic.php?f=46&t=1027

It would be better if you could assist Vassils and @sheepdoll with the HALMX core, rather then starting a new one based on the HAL


ekawahyu
Sun May 15, 2016 5:05 am
@RogerClark: I just forked HALMX_Arduino_STM32 repository from yours. It does not seem to work with Arduino 1.6.5? I tried every single board from the list and providing nothing but empty setup() and loop(). What am I missing here?

RogerClark
Sun May 15, 2016 6:06 am
I’m now running 1.6.9 as its backwards compatible with the existing libmaple core (and the HALMX core) (unlike 1.6.8 or 1.6.7 or 1.6.6)

The setup() and loop() functions are called by main.c (each board variant has a complete copy of the HALMX files as exported by the Cube)

Actually at the moment I’m now getting this error

arm-none-eabi-g++: error: unrecognized command line option '-CC -mcpu=cortex-m3'


Vassilis
Sun May 15, 2016 9:02 am
ekawahyu wrote:@RogerClark: I just forked HALMX_Arduino_STM32 repository from yours. It does not seem to work with Arduino 1.6.5? I tried every single board from the list and providing nothing but empty setup() and loop(). What am I missing here?

ekawahyu
Fri May 20, 2016 7:16 am
Finally! I got the blink sketch to build from Arduino IDE. There is still a lot of work to be done for MXDiscoF072RBTx variant.

https://github.com/ekawahyu/HALMX_Arduino_STM32

I stumbled across a couple of quite annoying issues, like STM32CubeMX keeps renaming and overriding *.S into *.s. This will never build on Arduino IDE because it looks for *.S file. I tried to patch the CMSIS repository directly by changing all startup files from .s suffix to .S, but it doesn’t seem to work.

Another issue is related to stlink_upload. It looks for libusb-1.0.0.dylib under /usr/local/lib, which I don’t have. My macports installation is on its default /opt/local/lib for everything. I also tried to create a symlink:

sudo ln -s /opt/local/lib/libusblibusb-1.0.0.dylib /usr/local/lib/libusb-1.0.0.dylib


RogerClark
Fri May 20, 2016 2:24 pm
stlink upload uses Texane STLink (see github)

You could try recompiling it on your machine and see if it finds the correct static library


ekawahyu
Fri May 20, 2016 4:39 pm
Building texane stlink works from the source, but it doesn’t reset the board properly. Pressing reset button on Discovery board doesn’t work either. I need to power cycle the board. That’s the only thing to see it working. What about using OpenOCD as part of the tools?

RogerClark
Fri May 20, 2016 4:45 pm
Are you reassigning the SWD pins as GPIO somewhere in the code ?

We see this with the Maple mini in libmaple as the SWD pins are reassigned to GPIO so that more GPIO pins are available.

So you have to use connect under reset and manually reset the board when moving from Bootloader uploads to STLink uploads on the Maple mini

Though after you have done one STLink upload it fixes the issue as the SWD pins are not reassigned in STLink upload in libmaple


ekawahyu
Fri May 20, 2016 7:15 pm
I don’t think I understand what you are saying, but I can tell that I don’t use STM32duino bootloader for F072. I assigned SWD pins on STM32CubeMX and there was no conflict with the rest of configuration. I could use OpenOCD to flash and debug without any reset issue. I don’t reassign any pin used by SWD as GPIO in the code as well.

It is weird. Only power cycle can make it execute code in the flash after uploading from Arduino. Sometimes I also got this error:

2016-05-20T14:10:56 INFO src/usb.c: -- exit_dfu_mode
2016-05-20T14:10:56 INFO src/common.c: Loading device parameters....
2016-05-20T14:10:56 INFO src/common.c: Device connected is: F07x device, id 0x20016448
2016-05-20T14:10:56 INFO src/common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 2048 bytes
2016-05-20T14:10:56 INFO src/common.c: Ignoring 4 bytes of 0xff at end of file
2016-05-20T14:10:56 INFO src/common.c: Attempting to write 21708 (0x54cc) bytes to stm32 address: 134217728 (0x8000000)

Flash page at addr: 0x08000000 erased
Flash page at addr: 0x08000800 erased
Flash page at addr: 0x08001000 erased
Flash page at addr: 0x08001800 erased
Flash page at addr: 0x08002000 erased
Flash page at addr: 0x08002800 erased
Flash page at addr: 0x08003000 erased
Flash page at addr: 0x08003800 erased2016-05-20T14:10:57 INFO src/common.c: Finished erasing 11 pages of 2048 (0x800) bytes
2016-05-20T14:10:57 INFO src/common.c: Starting Flash write for VL/F0/F3 core id
2016-05-20T14:10:57 INFO src/common.c: Successfully loaded flash loader in sram

Flash page at addr: 0x08004000 erased
Flash page at addr: 0x08004800 erased
Flash page at addr: 0x08005000 erased2016-05-20T14:10:59 ERROR src/common.c: flash loader run error
2016-05-20T14:10:59 ERROR src/common.c: run_flash_loader(0x8000000) failed! == -1

stlink_fwrite_flash() == -1


ekawahyu
Sat May 21, 2016 1:15 am
I just added OpenOCD as an alternative upload method, but it points to my local /opt/local/ binaries to make it work. Then next step would be building OpenOCD with static libraries and add it to the tools of HALMX_Arduino_STM32. The Windows binary, we can use the one from Freddie Chopin. It is quite some works to build for Mac and Linux. Anyone can help with this?

I am now working on the DFU support and need to make the USB CDC to work within Arduino IDE.

@rogerclark: Do you think we can move this thread and change the title somehow as I have logged a lot of work and notes for STM32F072B-Disco platform development? I just thought that it is not appropriate to stay under General discussion anymore. Thanks.


Rick Kimball
Sat May 21, 2016 3:28 am
ekawahyu wrote: Anyone can help with this?

ekawahyu
Sat May 21, 2016 4:13 am
@Rick: are you saying if I installed Zero from Board Manager, then the OpenOCD binaries are available already?

EDIT: Confirmed, built-in OpenOCD works! The Arduino SAMD Board (32-bit Cortex-M0+) needs to be installed to make it work.


ekawahyu
Mon May 23, 2016 5:55 am
USBSerial is tested to work on F072, however, the println method does not seem to add CR/LF at the end. I can’t make read method to read anything I type in from serial monitor nor picocom.

I started to see this ld warning, should I be worried about this warning?

packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes
/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes
/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes


Vassilis
Mon May 23, 2016 6:35 am
ekawahyu wrote:USBSerial is tested to work on F072, however, the println method does not seem to add CR/LF at the end. I can’t make read method to read anything I type in from serial monitor nor picocom.

I started to see this ld warning, should I be worried about this warning?

packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes
/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes
/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes


ekawahyu
Mon May 23, 2016 2:02 pm
@Vassilis: will do that tonight. I got one more thing to tell you. The STM32CubeMX generates a different macro for USB_LP_CAN1_RX0_IRQn. On the STM32F0, it is called USB_IRQn. I just wanted to tell you ahead of time so that we can think about how to better mitigate this difference with #define somewhere. What is your best suggestion to put this #define in?

Vassilis
Mon May 23, 2016 5:56 pm
ekawahyu wrote:@Vassilis: will do that tonight. I got one more thing to tell you. The STM32CubeMX generates a different macro for USB_LP_CAN1_RX0_IRQn. On the STM32F0, it is called USB_IRQn. I just wanted to tell you ahead of time so that we can think about how to better mitigate this difference with #define somewhere. What is your best suggestion to put this #define in?

Vassilis
Wed May 25, 2016 1:22 pm
ekawahyu wrote:@Vassilis: will do that tonight. I got one more thing to tell you. The STM32CubeMX generates a different macro for USB_LP_CAN1_RX0_IRQn. On the STM32F0, it is called USB_IRQn. I just wanted to tell you ahead of time so that we can think about how to better mitigate this difference with #define somewhere. What is your best suggestion to put this #define in?

ekawahyu
Wed May 25, 2016 3:10 pm
Sorry for not giving you the update, yes, the workaround works, but I could see that my Mac is heating up due to the number of retry of CDC_Transmit_FS(). The last time I checked, it could reach up to 50 retries before it throws USBD_OK.

I am planning to call CDC_Transmit_FS() periodically, with timer interrupt, or through SysTick. So, we need a transmit buffer to do this. I had a quick test by simply sending come characters and seemed that my Mac was happy about it :-) I can see that you commented out some code with tx buffer in there, is it a work in progress of sending data in bulk? What is the best timing for sending it? Every 1ms, 10ms? Hooking up with SysTick will be the simplest way to do it.


Vassilis
Wed May 25, 2016 4:23 pm
The main goal is to use an interrupt based tx buffer just like I did with the hardware Serial ports 1-3
The solution I gave you is temporary. That is why I haven’t sent a PR yet. I am working on the USBSerial tx buffer.

RogerClark
Wed Jun 01, 2016 11:45 am
Guys

I spoke to Vassilis on Skype chat

And I’m now using a modified version of the code to fix the USB send issue

size_t USBSerial::write(const uint8_t *buffer, size_t size)
{
unsigned long timeout=millis()+5;
if(hUsbDeviceFS.dev_state == USBD_STATE_CONFIGURED)
{
while(millis()<timeout)
{
if(CDC_Transmit_FS((uint8_t*)buffer, size) == USBD_OK)
{
return size;
}
}
}
return 0;
}


GrumpyOldPizza
Wed Jun 01, 2016 12:13 pm
ekawahyu wrote:USBSerial is tested to work on F072, however, the println method does not seem to add CR/LF at the end. I can’t make read method to read anything I type in from serial monitor nor picocom.

I started to see this ld warning, should I be worried about this warning?

packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes
/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes
/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .rodata by 4 bytes


ekawahyu
Wed Jun 01, 2016 4:15 pm
GrumpyOldPizza wrote:The fix for that is to align all relevant sections to the proper 8 byte boundaries. I don’t know how the ld script for HalMX looks like (always used my homegrown ones for ages), but here a link to one that work (you might be able to transfer the key alignments to yours):

https://github.com/GrumpyOldPizza/ardui … s/flash.ld


GrumpyOldPizza
Wed Jun 01, 2016 6:54 pm
ekawahyu wrote:GrumpyOldPizza wrote:The fix for that is to align all relevant sections to the proper 8 byte boundaries. I don’t know how the ld script for HalMX looks like (always used my homegrown ones for ages), but here a link to one that work (you might be able to transfer the key alignments to yours):

https://github.com/GrumpyOldPizza/ardui … s/flash.ld


ekawahyu
Wed Jun 01, 2016 7:06 pm
GrumpyOldPizza wrote:One thing though makes me wonder. Why would you need to regenerate a link script over and over again. I mean it’s fairly static for a given MCU. Perhaps this step could be skipped for HALMX as well.

Rick Kimball
Wed Jun 01, 2016 7:31 pm
My first experience giving CubeMX HAL on the stm32f103x a try was the screwed up .ld script. I figured if they can’t get the ld script right I shouldn’t trust anything else.

RogerClark
Wed Jun 01, 2016 9:12 pm
We have to patch multiple files after they are generated by the Cube.

Just off the top my head, I had to modify the code that defines the vector table offset, as its hard coded to 0x00, and hence the code wont work with a bootloader

I also had to make a new .ld file to match the bootloader offset 0x2000

And of course we have to modify main.c, and possibly other files.

So there is no way that we are ever going to just be able to export the cube files and make a new core, or update an existing core, without either manually patching the files, or perhaps have some automated patch system


ekawahyu
Wed Jun 01, 2016 9:50 pm
What if we do this, we keep the original HAL libraries (as separate folder for all drivers or libraries) untouched. Whatever source code needs modification, we provide it within the variant folder with the exact same name and extension. Then, the build script has to find the source from variant folder first prior to getting it from the drivers or libraries. Is it something feasible to do within platform.txt?

If we give users the freedom to generate the code on their own through STM32CubeMX, then we can’t really have hundreds of patches available for every possible configuration for them all. I don’t know, I am running out of idea… :(


RogerClark
Wed Jun 01, 2016 11:03 pm
ekawahyu wrote:What if we do this, we keep the original HAL libraries (as separate folder for all drivers or libraries) untouched.

Slammer
Wed Jun 01, 2016 11:20 pm
Normally the system_stm32f1xx.c is a typical example created by CubeMX ( a template) and must be moved together with the other sources of the project in upper directories. The /Drivers/CMSIS… directory contains only generic sources and headers related with CMSIS and are totally independent from project’s configuration.
Almost 99% of files inside CubeMX are steady for a specific STM32 family. Normally the files in the upper project’s directory are generated by CubeMX.

RogerClark
Wed Jun 01, 2016 11:36 pm
@slammer

Which other files are normally moved ?

Can we safely just delete the Cube generated verison of system_stm32f1xx.c and use one we create ourselves (in another location) ?
(though looking at what else is in this file, It looks possible that a new release of the Cube could generate different code into system_stm32f1xx.c, as there is lots of config stuff in there)


RogerClark
Thu Jun 02, 2016 12:12 am
Guys,

I’ve realised that this thread is crossing over with the HAL MX roadmap thread

I think we should probably discuss generic Cube related issues in the other thread..

I’m about to post there now, as we need to work out how to handle the additional pin modes that are not in the core Arduino API

i.e like INPUT_PULLDOWN

Thanks

Roger


stevech
Thu Jun 02, 2016 5:43 am
RogerClark wrote:We have to patch multiple files after they are generated by the Cube.

Just off the top my head, I had to modify the code that defines the vector table offset, as its hard coded to 0x00, and hence the code wont work with a bootloader

I also had to make a new .ld file to match the bootloader offset 0x2000

And of course we have to modify main.c, and possibly other files.

So there is no way that we are ever going to just be able to export the cube files and make a new core, or update an existing core, without either manually patching the files, or perhaps have some automated patch system


RogerClark
Thu Jun 02, 2016 6:49 am
I mean this

#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */


ekawahyu
Thu Jun 02, 2016 1:26 pm
RogerClark wrote:I mean this

#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */


ekawahyu
Thu Jun 02, 2016 1:36 pm
Ok, I just added dfu-util executables and scripts under tools, for Windows, Mac, and Linux. The binaries were taken from:

https://github.com/arduino/dfu-utils-cr … er/distrib

I am still working on the dfu_upload scripting for Windows, but I got some weird issue with dfu_upload script for Linux. It is able to send the magic word ‘1EAF’ over the serial port with ‘echo’, but it always says Device or Resource Busy the next time I try to execute this again. I have to wait for at least 40 seconds before I can hit upload button to flash the binary. What am I missing? It seems that I am opening a file/device somewhere in the script without closing it? See the script below. This script runs just fine on Mac.

#!/bin/bash

set -e

if [ $# -lt 4 ]; then
echo "Usage: $0 $# <dummy_port> <altID> <usbID> <binfile>" >&2
exit 1
fi
dummy_port=$1; altID=$2; usbID=$3; binfile=$4;dummy_port_fullpath="/dev/$1"

#if we can find the Serial device try resetting it and then sleeping for 1 sec while the board reboots

if [ -e $dummy_port_fullpath ]; then
echo "resetting " $dummy_port_fullpath
echo “1EAF” > $dummy_port_fullpath
sleep 1
fi

DFU_UTIL=$(dirname $0)/dfu_util/dfu-util
if [ ! -x ${DFU_UTIL} ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi

${DFU_UTIL} -d ${usbID} -a ${altID} -s 0x08000000:leave -D ${binfile}


ahull
Thu Jun 02, 2016 1:45 pm
Might the echo commands be behaving differently on the different platforms?

Example…
root@my_computer:~# echo -e "Hello" |hd
00000000 48 65 6c 6c 6f 0a |Hello.|
00000006
root@my_computer:~# echo -n "Hello" |hd
00000000 48 65 6c 6c 6f |Hello|
00000005
root@my_computer:~# echo -n "Hello\r" |hd
00000000 48 65 6c 6c 6f 5c 72 |Hello\r|
00000007
root@my_computer:~# echo -n "Hello\n" |hd
00000000 48 65 6c 6c 6f 5c 6e |Hello\n|
00000007
root@my_computer:~# echo "Hello\n" |hd
00000000 48 65 6c 6c 6f 5c 6e 0a |Hello\n.|
00000008
root@my_computer:~# echo "Hello\r" |hd
00000000 48 65 6c 6c 6f 5c 72 0a |Hello\r.|
00000008
root@my_computer:~# echo -e "Hello\r" |hd
00000000 48 65 6c 6c 6f 0d 0a |Hello..|
00000007
root@my_computer:~# echo -e "Hello\n" |hd
00000000 48 65 6c 6c 6f 0a 0a |Hello..|
00000007
root@my_computer:~#


GrumpyOldPizza
Thu Jun 02, 2016 1:49 pm
ekawahyu wrote:Ok, I just added dfu-util executables and scripts under tools, for Windows, Mac, and Linux. The binaries were taken from:

https://github.com/arduino/dfu-utils-cr … er/distrib

I am still working on the dfu_upload scripting for Windows, but I got some weird issue with dfu_upload script for Linux. It is able to send the magic word ‘1EAF’ over the serial port with ‘echo’, but it always says Device or Resource Busy the next time I try to execute this again. I have to wait for at least 40 seconds before I can hit upload button to flash the binary. What am I missing? It seems that I am opening a file/device somewhere in the script without closing it? See the script below. This script runs just fine on Mac.

#!/bin/bash

set -e

if [ $# -lt 4 ]; then
echo "Usage: $0 $# <dummy_port> <altID> <usbID> <binfile>" >&2
exit 1
fi
dummy_port=$1; altID=$2; usbID=$3; binfile=$4;dummy_port_fullpath="/dev/$1"

#if we can find the Serial device try resetting it and then sleeping for 1 sec while the board reboots

if [ -e $dummy_port_fullpath ]; then
echo "resetting " $dummy_port_fullpath
echo “1EAF” > $dummy_port_fullpath
sleep 1
fi

DFU_UTIL=$(dirname $0)/dfu_util/dfu-util
if [ ! -x ${DFU_UTIL} ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi

${DFU_UTIL} -d ${usbID} -a ${altID} -s 0x08000000:leave -D ${binfile}


RogerClark
Fri Jun 03, 2016 12:02 am
ekawahyu wrote:RogerClark wrote:I mean this

#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */


ekawahyu
Fri Jun 03, 2016 1:40 am
RogerClark wrote:I put the guard code around that define, the code from the Cube does not have it :-(

ekawahyu
Fri Jun 03, 2016 1:55 am
GrumpyOldPizza wrote:
Just really curious here. Why not use what Arduino supports directly ? A switch to 1200 baud and then deasserting RTS, and then waiting for 500ms to see whether the condition is taken away again. This way you don’t have to mess around in the dfu-util script …

The next problem with your script is that the “sleep 1” is not good enough. I found that sometimes it takes quite a long time till the DFU part is visible after re-enumeration. The logic the STM32L4 core is using simply waits for up to 10 seconds till the DFU thingy shows up (please no comments on style, I just wanted to get it working at the time):


RogerClark
Fri Jun 03, 2016 1:56 am
Umm

Thats interesting

There doesn’t seem to be any guard code in the F1 files.

I am trying to contact ST to find out if they can make some changes like this to the Cube, as it looks like it is inconsistent.


ekawahyu
Fri Jun 03, 2016 2:37 am
Just wanted to leave a note here saying that I have completed all dfu_upload scripts (and executables) for all three Windows, Linux, and Mac. The batch scripting looks really ugly, but that’s because of my lack of knowledge in batch scripting ;) All of these scripts should work just fine for any STM32 device with a built-in (system memory) DFU bootloader. You could, however, use them with your custom DFU bootloader, but I would suggest you to look at maple DFU instead which probably more stable.

All scripts expect to see a serial port prior to DFU flashing the target. It sends a magic word (1EAF) over the serial port and wait a second or two for the target to enter DFU mode. Then, the dfu-util executable is called to flash target and leave DFU mode immediately afterward. That’s all, and the uploaded sketch will run until the next magic word is captured and the whole process repeats.


RogerClark
Fri Jun 03, 2016 3:02 am
Re: Delay between USB reset etc

I have mainly seen this problem on OSX, which is why I passed the delay parameter as argument. (so people can change it, if it doesn’t work for them)

But the way the bootloader has to reset the USB is an on-going issue.

I recall that Leaflabs, did it that way, because of issues on Windows XP with composite USB devices (where they wanted the bootloader to be both DFU and CDC Serial – but it only worked on OSX and Linux)

The composite device problem may have been fixed in Windows 7, and I see plenty of devices e.g the BlackMagic probe, and the STM Nucleo STLink etc, operating as composite devices on Windows with no problems at all.

However, it would require a complete rewrite of the bootloader and a big modification to the sketch core code, to use the bootloader for both DFU and CDC serial.

And… This would not allow the use of HID in the sketch, unless the Bootloader also had HID, or perhaps Midi, or Mass Storage etc built into its composite device

So… It may still be better to reset the USB when the bootloader is complete, so that the sketch can be many different USB devices (depending on what the user has programmed – perhaps)

With the F103 bootloader, the other option would be to use a serial upload protocol rather than DFU, as it is already built into the IDE.

I know that @jcw was writing a new bootloader which uses the AVR upload protocol (Sorry I can’t remember the protocol name), but I don’t think he finished, as his bootloader worked completely differently.
I just looked on https://github.com/jeelabs but I can’t see it as a public repo, so perhaps its somewhere else or a private repo

But DFU is supported as part of the F4 and some other STM32 devices, so it seems to make sense to use DFU for all devices, as we can have common uploader scripts and utils


ahull
Fri Jun 03, 2016 11:15 am
ekawahyu wrote:GrumpyOldPizza wrote:
Just really curious here. Why not use what Arduino supports directly ? A switch to 1200 baud and then deasserting RTS, and then waiting for 500ms to see whether the condition is taken away again. This way you don’t have to mess around in the dfu-util script …

The next problem with your script is that the “sleep 1” is not good enough. I found that sometimes it takes quite a long time till the DFU part is visible after re-enumeration. The logic the STM32L4 core is using simply waits for up to 10 seconds till the DFU thingy shows up (please no comments on style, I just wanted to get it working at the time):


ekawahyu
Fri Jun 03, 2016 1:56 pm
ahull wrote:Have you got modem manager installed? See here -> http://www.stm32duino.com/viewtopic.php … t=10#p5935

GrumpyOldPizza
Sat Jun 04, 2016 12:24 pm
ekawahyu wrote:GrumpyOldPizza wrote:
Just really curious here. Why not use what Arduino supports directly ? A switch to 1200 baud and then deasserting RTS, and then waiting for 500ms to see whether the condition is taken away again. This way you don’t have to mess around in the dfu-util script …

The next problem with your script is that the “sleep 1” is not good enough. I found that sometimes it takes quite a long time till the DFU part is visible after re-enumeration. The logic the STM32L4 core is using simply waits for up to 10 seconds till the DFU thingy shows up (please no comments on style, I just wanted to get it working at the time):


GrumpyOldPizza
Sat Jun 04, 2016 12:31 pm
RogerClark wrote:Re: Delay between USB reset etc

I recall that Leaflabs, did it that way, because of issues on Windows XP with composite USB devices (where they wanted the bootloader to be both DFU and CDC Serial – but it only worked on OSX and Linux)

The composite device problem may have been fixed in Windows 7, and I see plenty of devices e.g the BlackMagic probe, and the STM Nucleo STLink etc, operating as composite devices on Windows with no problems at all.


ekawahyu
Sat Jun 04, 2016 1:30 pm
GrumpyOldPizza wrote:You don’t need an RTS pin with USB/CDC. There is SET_CONTROL_LINE_STATE which sets/clears DTR/RTS. Anyway, I was wrong about RTS, meant DTR. The core for that is straight forward:

if (r == CDC_SET_LINE_CODING)
{
USBDevice.recvControl((void*)&_usbLineInfo, 7);
}

if (r == CDC_SET_CONTROL_LINE_STATE)
{
_usbLineInfo.lineState = setup.wValueL;
}

if (r == CDC_SET_LINE_CODING || r == CDC_SET_CONTROL_LINE_STATE)
{
// auto-reset into the bootloader is triggered when the port, already
// open at 1200 bps, is closed. We check DTR state to determine if host
// port is open (bit 0 of lineState).
if (_usbLineInfo.dwDTERate == 1200 && (_usbLineInfo.lineState & 0x01) == 0)
{
initiateReset(250);
}
else
{
cancelReset();
}
return false;
}


RogerClark
Sat Jun 04, 2016 9:08 pm
do you mean the Arduino CDC reset code

https://github.com/arduino/Arduino/blob … no/CDC.cpp


ekawahyu
Mon Jun 13, 2016 8:42 pm
ahull wrote:Have you got modem manager installed? See here -> http://www.stm32duino.com/viewtopic.php … t=10#p5935

ekawahyu
Thu Jun 23, 2016 7:22 pm
I have been banging my head against the wall to make Serial1 to work. The Serial1 interrupt works just fine, but the handler never fills any incoming byte to the Serial1 buffer. So, this read method in UARTClass always returns -1:

int UARTClass::read( void )
{
// if the head isn't ahead of the tail, we don't have any characters
if ( rx_buffer.iHead == rx_buffer.iTail )
return -1;

uint8_t uc = rx_buffer.buffer[rx_buffer.iTail];
rx_buffer.iTail = (unsigned int)(rx_buffer.iTail + 1) % SERIAL_BUFFER_SIZE;
return uc;
}


RogerClark
Thu Jun 23, 2016 9:22 pm
Its possible that the problem is caused by a bug in the MCU its self.

There is an Errata document that STM publish for the F103, so it may be worth finding it, to check if this is listed.

Is it possible that this status flag is beging updated directly by the hardware?

Also, as you are using the HAL, you could post to STMs own support forum.
They usually provide responses to this type of question.


ekawahyu
Thu Jun 23, 2016 10:28 pm
Good point! I just checked the errata sheet, but nothing mentioning about issue with USART1. But it is good to know that it has some limitation with the I2C.

Anyway, I just tested a plain project without mapleMX and it works just fine. I still don’t understand how is that possible? There is only HAL_UART_Receive_IT() being called once within UARTClass::init(). Maybe there is other methods get called and set this huart1->State to Ready state?


RogerClark
Thu Jun 23, 2016 11:13 pm
I would start commenting out the receive code to try to isolate which part of it is causing the problem

It sounds like you are using GDB? Is there a way to puy a “watch” breakpoint on that variable ?
https://sourceware.org/gdb/onlinedocs/g … oints.html


ekawahyu
Fri Jun 24, 2016 6:51 am
Yeah, I use GDB. I finally found the culprit that set the huart1->State to ready. It was part of the UART1 init I forgot to put in Serial1::init(). Problem solved! Thanks for the tips!

Next issue (or perhaps I need some suggestion), the STM32F072 has the half-duplex feature within its UART peripherals. This requires enabling/disabling TX/RX simultaneously. So, before sending data, it needs to switch the line to TX Mode, afterwards it has to switch back to RX Mode.

1. I am planning to add a data member called UARTClass._mode to select its mode like Async, Sync, Half-Duplex, LIN, etc. By default, if user’s sketch only configure Serial1.begin(baudrate), _mode will be assigned with ASYNC. Do you think we should provide user with a separate method to configure it such as in Serial1.mode(HALF-DUPLEX), or we just do Serial1.begin(baudrate, mode)?

2. Do you think we should allow user to do TX/RX switching from within the sketch? For example, Serial1.switchline(TX), Serial1.switchline(RX). Or should we do a seamless switch, so that Serial1 looks like normal serial communication with built-in auto-switching?


RogerClark
Fri Jun 24, 2016 7:48 am
I think its fine to add features to the Serial class (Hardware serial / UART), we already do this with SPI , with setModule as we have to be able to support features which normal Arduino’s don’t have ;-)

I recall that @grumpOldPizza was investigating how to change baud rates in his core, and the consensus was that you need to call Serial.end() before you can call Serial.begin(xxxx) to change the baud rate.
Because he was having some issues changing the baud rate while the Serial device was still active, i.e I think he needed to deactivate it to change baud rates, hence the need to calll Serial.end() first

So perhaps the other option is to overload and add Serial.begin(int rate,int config = DEFAULT_CONFIG, int mode=FULL_DUPLEX)

But I don’t know anything about Serial1.switchline(TX) etc, so I can’t advise on that aspect.


ekawahyu
Fri Jun 24, 2016 2:05 pm
I think we need to agree on the naming, because _mode is kind of misleading if you look at UARTModes. But the Cube calls Half-Duplex, Async, etc as modes

EDIT: I think what we call UARTModes enumeration can be renamed to UARTParams, then use UARTModes to match the Cube

EDIT2: What is the status of USARTClass.cpp development? It seems that it has header dependency of UARTClass.h

EDIT3: Please look at my changes here: https://github.com/ekawahyu/HALMX_Ardui … ARTClass.h

What is the convention for variable and method naming? I can see _dw as in double word, but what does r prefix in r_byte mean? I can fix the mode naming to follow the convention


ekawahyu
Thu Jun 30, 2016 8:26 am
UARTClass is final! What used to be called “mode” has been refactored as “param”. Now we have params (8N1, 8E1, etc), mode (full/half duplex), ctrl (blocking/non-blocking TX). By default, when user calls Serial1.begin(9600), params = 8N1, mode = full-duplex, ctrl=non-blocking.

class UARTClass : public HardwareSerial
{
public:
enum UARTParams {
Param_8N1 = 0, //US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_NO,
Param_8E1, // = US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_EVEN,
Param_8O1, // = US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_ODD,
Param_8M1, // = US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_MARK,
Param_8S1 // = US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_SPACE,
};
enum UARTModes {
Mode_Full_Duplex = 0,
Mode_Half_Duplex
};
enum UARTCtrl {
Ctrl_Non_Blocking = 0,
Ctrl_Blocking
};
.
.
.
void begin(const uint32_t dwBaudRate);
void begin(const uint32_t dwBaudRate, const UARTParams param);
void begin(const uint32_t dwBaudRate, const UARTModes mode);
void begin(const uint32_t dwBaudRate, const UARTCtrl ctrl);
void begin(const uint32_t dwBaudRate, const UARTParams param, const UARTCtrl ctrl);
void begin(const uint32_t dwBaudRate, const UARTModes mode, const UARTCtrl ctrl);
void begin(const uint32_t dwBaudRate, const UARTParams param, const UARTModes mode, const UARTCtrl ctrl);
.
.
.
uint8_t r_byte;
uint8_t _mode;
uint8_t _ctrl;
ring_buffer tx_buffer;// = { { 0 }, 0, 0};
ring_buffer rx_buffer;// = { { 0 }, 0, 0};

};


RogerClark
Thu Jun 30, 2016 10:37 am
OK

Where are you going to post your final code? GitHub ??


ekawahyu
Thu Jun 30, 2016 3:19 pm
Yes, I pushed the changes to my Github already: https://github.com/ekawahyu/HALMX_Ardui … its/master Commit number: fdfd040. Let me know if the UARTClass builds with your platform.

ekawahyu
Thu Jun 30, 2016 8:49 pm
Question to the attached structure below, is there any reason why we use all member as uint32_t instead of uint16_t? Is it only because of the 4 bytes memory alignment?

typedef struct _Pin2PortMapArray
{
GPIO_TypeDef *GPIOx_Port; /* defined in stm32f401xe.h */
uint32_t Pin_abstraction; /* must match type in GPIO_InitTypeDef struct */
uint32_t adc_channel;
uint32_t timerNumber; //Timer1 to Timer4.
uint32_t timerChannel; //Timer channel (1-4).
} Pin2PortMapArray;


martinayotte
Thu Jun 30, 2016 9:20 pm
Personally, I think this is simply due to LeafLab legacy code, because there is no reason that the last 3 members shouldn’t even be a uint8_t, since values are never outside 0-255 range.

RogerClark
Thu Jun 30, 2016 10:46 pm
I agree with martin.

they should probably be changed to uint8_t

This should yield a small memory saving, but possibly increase code size, as natively the STM32 handles 32 bit


martinayotte
Fri Jul 01, 2016 2:35 am
… and if there is speed penalty of using an non-alignment to 32bits for the whole structure, we could add a “uint8_t unused;” to rectify this, which can still be use in the futur.

RogerClark
Fri Jul 01, 2016 2:51 am
Guys,

You can double check this. But I just changed the header in question and it made no difference to either the RAM or Flash usage (please try this yourself in the HAL MX core in the MX Blue Pill variant.h

I’ve not done a binary compare of the code, but I suspect its functionally the same

There may be a compiler option which changes the structure packing, but I doubt its worth messing around with.

Re:
uint8_t unused

I don’t think its necessary as there already appear to be 4 uint8_t’ so the whole struct would be a multiple of 32 bits in length, as I presume the pointer to GPIO_TypeDef will be 32 bits


martinayotte
Fri Jul 01, 2016 3:17 am
RogerClark wrote:I don’t think its necessary as there already appear to be 4 uint8_t’ so the whole struct would be a multiple of 32 bits in length, as I presume the pointer to GPIO_TypeDef will be 32 bits

ekawahyu
Fri Jul 01, 2016 3:19 am
Ok, I am not going to modify any existing member declaration, let’s keep it as it is. The reason I am asking about it, it was because I needed to add one new member in it. So, 32-bit it is:

typedef struct _Pin2PortMapArray
{
GPIO_TypeDef *GPIOx_Port; /* defined in stm32f401xe.h */
uint32_t Pin_abstraction; /* must match type in GPIO_InitTypeDef struct */
uint32_t adc_channel;
uint32_t timerNumber; //Timer1 to Timer4.
uint32_t timerChannel; //Timer channel (1-4).
uint32_t altFunction; //Alternate function
} Pin2PortMapArray;


martinayotte
Fri Jul 01, 2016 3:22 am
“altFunction” is also in 0-255 range, so I would declare it as “uint8_t” too…

RogerClark
Fri Jul 01, 2016 3:39 am
I agree

We may as well declare them all at the correct size (unit8_t), even if the compiler chooses to ignore it

(Worst case scenario we now need to pad with 3 more “unused” uint8_t vars)


ekawahyu
Fri Jul 01, 2016 2:56 pm
Ok, I will give it a try. Right now I am stuck at this within analogWrite() function:

if(ulPin != _ulPin){
uint8_t i, res = 0;
for(i=0;i<MAX_PWM_PIN;i++){
if(enabledPWMpins[i] == ulPin){
enabledPWMpins[i] = ulPin;
res = 1;
}
}
if(res == 1)
MX_TIMx_Init(ulPin);
_ulPin = ulPin;
}


martinayotte
Fri Jul 01, 2016 3:22 pm
Indeed, it seems to be a piece of code never completed … :ugeek:

ekawahyu
Fri Jul 08, 2016 3:44 pm
Ok, so I got the initial analogWrite() to work, but I need some clarification about map() or mapResolution(). I can see that map() is within the Arduino API, but why do we need to have mapResolution() in wiring_analog.c?

EDIT: Oh, I get it, because by default the write resolution of Arduino is 8-bit. Well, this leads me to my next question, do we have to keep the PWM frequency the same as Arduino at 490Hz or 980Hz, or should we provide an extended API for user to be able to modify the frequency?


martinayotte
Fri Jul 08, 2016 5:25 pm
I think it would be good to be able to set the frequency, the ESP8266 provide such functionality with analogWriteFreq().

ekawahyu
Fri Jul 08, 2016 11:01 pm
Ok, analogWriteFrequency() added, but how do I get the new function highlighted on Arduino IDE?

Screen Shot 2016-07-08 at 5.58.29 PM.png
Screen Shot 2016-07-08 at 5.58.29 PM.png (10.95 KiB) Viewed 992 times

Rick Kimball
Sat Jul 09, 2016 3:19 am
Edit: $ARDUINO_INSTALL_DIR/lib/keywords.txt

$ grep analogWrite ~/github/Arduino/build/linux/work/lib/keywords.txt
analogWriteFrequency KEYWORD2 AnalogWrite
analogWrite KEYWORD2 AnalogWrite
analogWriteResolution KEYWORD2 AnalogWriteResolution

BTW: energia (msp430/arm port to ti chips) calls it analogFrequency(HZ) and it applies to all pins

http://forum.43oh.com/topic/4858-solved … a/?p=43233


ekawahyu
Sat Jul 09, 2016 5:18 am
Thanks Rick for the pointer! Instead of tweaking the Arduino installation, I added a dummy ArduinoSTM32 library and add my keywords in there. This way, any enhanced API can all get highlighted by simply adding the keyword in ArduinoSTM32, rather than modifying Arduino installation keywords.

https://github.com/ekawahyu/HALMX_Ardui … /libraries


RogerClark
Sun Jul 10, 2016 3:25 am
Core specific Keywords is something which should be raised as an issue on the Arduino IDE github account , or possibly the IDE developers mailing list.

i.e they could add the ability to add keyboards to each third party core.


ekawahyu
Mon Jul 11, 2016 6:09 am
RogerClark wrote:Core specific Keywords is something which should be raised as an issue on the Arduino IDE github account , or possibly the IDE developers mailing list.

i.e they could add the ability to add keyboards to each third party core.


RogerClark
Mon Jul 11, 2016 6:53 am
Re: Tone

I think Leaflabs just forgot to write it, or perhaps it was not part of Arduino prior to version 1.0

I recall someone may have now written the code for this, so try searching the forum e.g. via google site:stm32duino.com and see if you can find their code.


ekawahyu
Sat Jul 16, 2016 3:48 am
RogerClark wrote:I recall someone may have now written the code for this, so try searching the forum e.g. via google site:stm32duino.com and see if you can find their code.

ekawahyu
Tue Aug 02, 2016 1:50 am
I got stuck with not being able to send “1EAF” in the Batch file. The command line “echo 1EAF > COMn” does not seem to work on Windows 7. Anyone knows other alternative of command line to use on Windows 7?

ekawahyu
Tue Aug 02, 2016 5:11 pm
ekawahyu wrote:I got stuck with not being able to send “1EAF” in the Batch file. The command line “echo 1EAF > COMn” does not seem to work on Windows 7. Anyone knows other alternative of command line to use on Windows 7?

RogerClark
Tue Aug 02, 2016 9:52 pm
GDB has the same issue for double digit COM port numbers, and has the same workaround

Leave a Reply

Your email address will not be published. Required fields are marked *