Giter Club home page Giter Club logo

arduino-stm32l4's Introduction

Arduino Core for STM32L4 based boards

Supported boards

Tlera Corp

STMicroelectronics

  • NUCLEO-L432
  • NUCLEO-L476

Installing

Board Manager

  1. Download and install the Arduino IDE (at least version v1.6.8)
  2. Start the Arduino IDE
  3. Go into Preferences
  4. Add https://grumpyoldpizza.github.io/arduino-STM32L4/package_STM32L4_boards_index.json as an "Additional Board Manager URL"
  5. Open the Boards Manager from the Tools -> Board menu and install "STM32L4 Boards by Tlera Corp"
  6. Select your STM32L4 board from the Tools -> Board menu

OS Specific Setup

Linux
  1. Go to ~/.arduino15/packages/grumpyoldpizza/hardware/stm32l4/<VERSION>/drivers/linux/
  2. sudo cp *.rules /etc/udev/rules.d
  3. reboot
Windows
STM32 BOOTLOADER driver setup for Tlera Corp boards
  1. Download Zadig
  2. Plugin STM32L4 board and toggle the RESET button while holding down the BOOT button
  3. Let Windows finish searching for drivers
  4. Start Zadig
  5. Select Options -> List All Devices
  6. Select STM32 BOOTLOADER from the device dropdown
  7. Select WinUSB (v6.1.7600.16385) as new driver
  8. Click Replace Driver
USB Serial driver setup for Tlera Corp boards (Window XP / Windows 7 only)
  1. Go to ~/AppData/Local/Arduino15/packages/grumpypoldpizza/hardware/stm32l4/<VERSION>/drivers/windows
  2. Right-click on dpinst_x86.exe (32 bit Windows) or dpinst_amd64.exe (64 bit Windows) and select Run as administrator
  3. Click on Install this driver software anyway at the Windows Security popup as the driver is unsigned
ST-LINK V2.1 driver setup for NUCLEO boards
  1. Plugin NUCLEO board
  2. Download and install ST-Link USB Drivers

From git (for core development)

  1. Follow steps from Board Manager section above
  2. cd <SKETCHBOOK>, where <SKETCHBOOK> is your Arduino Sketch folder:
  • OS X: ~/Documents/Arduino
  • Linux: ~/Arduino
  • Windows: ~/Documents/Arduino
  1. Create a folder named hardware, if it does not exist, and change directories to it
  2. Clone this repo: git clone https://github.com/grumpyoldpizza/arduino-STM32L4.git grumpyoldpizza/stm32l4
  3. Restart the Arduino IDE

Recovering from a faulty sketch for Tlera Corp Boards

Sometimes a faulty sketch can render the normal USB Serial based integration into the Arduindo IDE not working. In this case plugin the STM32L4 board and toggle the RESET button while holding down the BOOT button and program a known to be working sketch to go ack to a working USB Serial setup.

Credits

This core is based on the Arduino SAMD Core

arduino-stm32l4's People

Contributors

grumpyoldpizza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-stm32l4's Issues

I2C in slave mode

Hi,

I'm trying to set up a Butterfly to act as an I2C slave device. It receives data just fine but trying to send data back in the request callback just ends up having 0's be received on the other end.

I think what is happening is when the callback calls Wire.write, write checks to see if _tx_active is true. If it isn't true, it just early exits, returning 0.

I think one way this could be addressed would be to set _tx_active before calling the request callback from TwoWire::EventCallback and then setting it false again afterwards.

So instead of:

	if (events & I2C_EVENT_TRANSMIT_REQUEST) {
	    _tx_write = 0;

	    if(_requestCallback) {
		(*_requestCallback)();
	    }
      
	    stm32l4_i2c_service(_i2c, &_tx_data[0], _tx_write);
	}

Have something like this:

	if (events & I2C_EVENT_TRANSMIT_REQUEST) {
	    _tx_write = 0;
	    _tx_active = true;

	    if(_requestCallback) {
		(*_requestCallback)();
	    }
      
	    _tx_active = false;

	    stm32l4_i2c_service(_i2c, &_tx_data[0], _tx_write);
	}

openocd binary linked to 32-bit version of libudev

When running on 64-bit Fedora Linux 25 and attempting to flash NUCLEO-L432KC using the STLink-v2 option in Arduino IDE, it fails saying that openocd cannot find libudev.so.1. It turns out that the binary is looking for the 32-bit version of the library which is not installed by default. After installing the 32-bit version of the library (systemd-libs) openocd was able to execute.

I don't know the proper solution to this, add an instruction to tell users to install the 32-bit library? Include both 32-bit and 64-bit versions of openocd?

STM32L476 Nucleo USER button doesn't function

Hi , I am using STM32L476 Nucleo board. But when I load example code "button". The USER button doesn't take effect. I have test the read back status of USER button via Serial port . It turn out to be random values.
I have tested example code "blink" which works good.
And I have tried to upload ST offical demo code hex "STM32CubeL4_Demo_STM32L476RG_Nucleo.hex". It works fine. And the button works too.
So I suppose it is configuration problem, right? But I have searched in google and other platform . I couldn't find answer. Could you help me?

Here is my configuration and platform.
OS : tested in MAC OS Sierra and Win 7 ultimate x64
Arduino IDE 1.8.3
Board : Nucleo-64
Board part number : Nucleo L476RG
Upload method : Stlink
Usb inter face : none
Other serial instance : all
Port : serial port 1423

Code :
int buttonPin = 2; // the number of the pushbutton pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT);
pinMode(buttonPin, INPUT);
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(LED_BUILTIN, HIGH);
} else {
// turn LED off:
digitalWrite(LED_BUILTIN, LOW);
}
Serial.println(buttonState);

delay(1000); // delay in between reads for stability
}

compiling wonderfull in eclipse arduino plugin, but code recognition ist broken

I added the json to my locations and loaded a new sketch using the boardfiles for my NUCLEO-L432KC
I can compile and modify it without issues and it runs, but the whole project won't recognize its includes, all includes are "unresolved" and macros and types are undefined

did i just miss something? haven't had this in eclipse projects for ages ... last time I remember was when I acidentially used another compiler but the project setting was still in "built-in" mode and had not details on how to serve the project ... i can not find any discrepancies like that yet as far as i have seen

PS: i wanted to add that it now only can not recognize basic datatypes like uint32_t and so on ... i am a little lost as the arduino configs do not allow deeper insight

Butterfly analogWrite and pinMode conflicts

There seems to be a problem with calling pinMode multiple times and using analogWrite.
The following code will fail for me:

static const int MOSFET = 9;

void setup() {
  //ON
  pinMode(MOSFET, OUTPUT);
  analogWrite(MOSFET, 255);
  delay(1000);
  //OFF
  analogWrite(MOSFET, 0);
  delay(3000);
  //ON
  pinMode(MOSFET, OUTPUT);//This pinMode causes problems
  analogWrite(MOSFET, 255);
  delay(1000);
  //OFF
  analogWrite(MOSFET, 0);
  pinMode(MOSFET, INPUT);
}

void loop() {
  delay(1);
}

Quite a few of the Arduino universe libraries use this format so its a bit frustrating to change them all.

getVBUS function output

Hi,
A question about the function getVBUS.

I am using a Grasshopper board (LoRa), powered with two 1.5 batteries which give 3.2V. I am powering it through the LDO voltage regulator.

I would like to include the voltage level into the periodic upload message to be aware of the state of charge of the batteries.

When I call the function "Serial.print(STM32L0.getVBUS());" I get a "1" on the Arduino serial monitor.
Is this what I am supposed to get? How would the message change as the voltage drops?

Thanks
Riccardo

a small wishlist

since i don't know how the HAL works, i thought i'd say my ideas for now.

USB:
selectable USB modes (raw hid, flash storage, MIDI instument)

MPU:
MPU support

SPI:
DMA support
16bit transfers
32bit transfers

Support:
a RTOS

More examples:
low power modes
SPI with DMA example
MPU example

PIN_MAP missing

is there a way to get similar information like in other STM32 boards by the PIN_MAP?
like this one:
https://github.com/arduino-org/arduino-core-stm32f4/blob/e14d9abe4c33e3e37db11218227b7683333c5837/variants/otto/variant.cpp

I want to bring the NeoPixelBus library (issue-172) to life, but it uses something like this to send out the pixel values:

...
uint32_t  pinMask = BIT(PIN_MAP[pin].gpio_bit);
volatile uint16_t* set = &(PIN_MAP[pin].gpio_device->regs->BSRRL);
volatile uint16_t* clr = &(PIN_MAP[pin].gpio_device->regs->BSRRH);
...

Is it possivle to work with I2S?

Could someone please guide me on how to make the I2S protocol work with the ICS43434 (MEMS Microphone) so I could use a FFT to get the frequency domain. And after that apply the perseval theorem to get the dB measurement of that signal.

ps: I think the Hamming window will be used.

can't compile on arm64 arch

fork/exec /home/pine64/.arduino15/packages/grumpyoldpizza/hardware/stm32l4/0.0.26/tools/linux//dfu-suffix: exec format error
Error compiling for board Dragonfly-L476RE.

using Arduino 1.8.3 with the package version 0.26, on ubuntu xenial (Release ubuntu 16.04.3 LTS (Xenial Xerus) 64-bit with kernel 3.10)

any idea for a solution?

TIM2_IRQHandler

line 737 stm32l4_timer.c, TIM2_IRQHandler needs to move outside #if defined(STM32L476xx)

error when uploading sketch?

so i try to compile my stuff, which succeeds, then my Arduino IDE wants to upload it to the board, the blue flashing led goes off, and i get an error message
"There was an error during upload with uploading the sketch"

however, when i reset my dragonfly (reset switch), it simply runs the initial bootloader blinky again.

my IDE version: Arduino.cc IDE 1.6.11
Latest board package (had the same with version .16 which i had before)
OS:win 8.1 which is up to date (including drivers)

could it be my 'programmer' setting?
i currently tried the st-link, stm32 bootloader, and arduinoisp

Nucleo_L476RG

Hello GrumpyOldPizza,
First of all thanks for your effort of ported libraries to Nucleo.
I am using the Nucleo L476RG as it is easy to buy (in Portugal) and test but can not upload using the Arduino IDE do I need to perform some trick?
My idea is just to implement a low power device to record 1 analog input periodically for about a minute or so and record the values to an uSD card. The L476 seems to me a very good ultra low power for standby applications.
Any advise is well come.
Thanks.
All the best,
Tim

dfu-suffix

Writing software for Ladybug and I get this error:
Build options changed, rebuilding all fork/exec /home/brian/.arduino15/packages/grumpyoldpizza/hardware/stm32l4/0.0.26/tools/linux//dfu-suffix: no such file or directory Error compiling for board Ladybug-L432KC.

I'm using Arduino 1.8.3 on Fedora 27. Ladybug shows up correctly under "Port" when it's plugged in.

Library for X_NUCLEO_IDB05A1

@GrumpyOldPizza: Dear Thomas, I want to use X_NUCLEO_IDB05A1 Bluetooth shield with Nucleo L476RG board. If I use STM32DUINO core then the sample code at : https://github.com/stm32duino/X-NUCLEO-IDB05A1 works fine. But when I use it with grumpyoldpizza core then it gives following error:
/home/mayukh/Arduino/libraries/arduino_792491/src/ble_clock.h:24:25: fatal error: wiring_time.h: No such file or directory

Is there any suitable library or example code for using X_NUCLEO_IDB05A1 with grumpyoldpizza core?

Thanks,
Mayukh

a way to reduce power consumption further

A possible way to achieve this is by disabling USB on request in the code, as right now it remains on at all times(?), consuming a bit power.
or by simply adding a compile option for the usb port, example:
Serial+Files
Serial only
Files only
RAW HID
No USB

Problems with i2c

I have problem using i2c comunication
i am using mpu6050 i dont know why but the program is freezing and interrupts still working

Some questions

Which is the reference library you rely on? Cube? A custom one?
What's the purpose of "boot_stm32l4xx.c"?

RTC Libary not setting properly Butterfly

Hey Grumpy,
Having a small problem with the RTC library for this core. The epoch stuff seems to be a bit off.

#include <RTC.h>

void setup() {
  Serial.begin(9600);
  delay(2000);
  RTC.setEpoch(1565734851);
  Serial.println(RTC.getEpoch());
  RTC.setYear(2019);
  Serial.println(RTC.getEpoch());
}

Will print this

1565734851
3080499651

Not sure why setting the year causes such confusion.

STM32F476RE - USB not recognized

I'm want use ST25R3911B-DISCO board with this core.
Programm downloading and normal working. But USB dsn't work, it not recognized, it no usb enumeration in windows.
I'm try compiling with this and unsuccessfully:
#define STM32L4_CONFIG_USB_VBUS GPIO_PIN_NONE
I'm try directly connect 5V to PA9, not happening too.
What can be wrong?

USB CDC on Nucleo 476RG

Hi,

Thanks for this awesome core! It makes it so much easier to program those STM32L4 chips...

I am trying to add a CDC UART on a Nucleo 476 board, with a micro USB adapter on pins PA9/PA11/PA12. This setup is programmed as a Dragonfly variant, via the onboard ST-Link.

When plugged through its USB CDC port, the board is correctly recognized by Windows, and I can connect to it with a terminal application on the computer. It receives the strings sent via the serial terminal on the PC, but an exception is raised on the microcontroller when it tries to send some data to the PC, and the data never makes it to the terminal application.

Any clue as to what might be going on? Is the USB CDC code only compatible with the Dragonfly's L476RE, and not the Nucleo's L476RG chip?
Thanks,

Armel

USB board on Dragonfly

I am trying to compile an Arduino usb hostshield code and the compiler says ''please define board in avrpins.h''.
How can i do this, i am on Linux, manjaro, and found the avrpins.h file and see there is no
STM32F4 entry, can i put it in, and yes what? Or can i use the teensy pinout in the code(how does one do that) for the dragonfly since they are lookalikes.
Is this the good place for this question or is there a better place to find answers for this kind of things. I am learning a lot of things especialy looking for answers and where to ask.
Thanks in advance, Dian from the Netherlands

seek(0) doesn't work

Because SeekMode enum doesn't match the defines in dosfs_api.h

Suggested fix:

enum SeekMode {
SeekSet = F_SEEK_SET,
SeekCur = F_SEEK_CUR,
SeekEnd = F_SEEK_END
};

Ladybug MSC/DOSFS

I'd like to use USB/MSC with the Ladybug and a SD card on an SPI interface. I must be missing something fairly trivial since I'm not able to get this to work. Are there any examples for this functionality?

Thanks!
Brian

Butterfly board not recognized by automatic board selection

Hi Thomas,
I'm playing with Butterfly board from Kris Winer. I had success compiling and uploading code from the Kris' examples.
This Issue surfaced later, when I added some more code to his example. This code ran fine on Teensy3.2 before I tried to migrate to Butterfly.
I contacted with the author of the library that I was using and he pointed me out in the direction here:


"I think automatic board selection does not recognize your board. You can force it to use avr by defining on the beginning
#define USE_N2K_CAN 4

before your line
#include "NMEA2000_CAN.h"


I did that, but then I got different error


"n file included from /Volumes/MrBig/Users/Jordans/Documents/Arduino/libraries/NMEA2000-master/NMEA2000_CAN.h:88:0,
from /Volumes/MrBig/Users/Jordans/Documents/Arduino/Ultimate_sensor_fusion_compass_V0.2/Ultimate_sensor_fusion_compass_V0.2.ino:52:
/Volumes/MrBig/Users/Jordans/Documents/Arduino/libraries/avr_can-master/avr_can.h:78:10: error: #error Unsupported CPU in avr_can.h
#error Unsupported CPU in avr_can.h
^
/Volumes/MrBig/Users/Jordans/Documents/Arduino/libraries/avr_can-master/avr_can.h:218:10: error: #error CPU Frequency F_CPU value not supported in avr_can.h
#error CPU Frequency F_CPU value not supported in avr_can.h"


Obviously that (AVR) wasn't the right CPU architecture.
My question is if there a compatibility issue with STM32L processor and Arduino sketches, or is something in my install not correct?
I did compile the code examples successfully, so I'm thinking it is not the install. Is there plan to make the transition to these new boards easier? I did transition from Arduino to Teensy3.2 and that was really smooth with out any major issues. I like the Butterfly board, but I had few issues trying to transition.
Any direction you can provide?
thanks,
Jordan

COM port allocation

Dear Thomas, Kris,

I have a Dragonfly, a Butterfly and a Ladybug boards.
I have uploaded a sketch to a Dragonfly, while the board manager was set to Butterfly and then uploaded a sketch to Butterfly, when board was set to Dragonfly.
Since then I can not setup them to have a COM port on Win10. I have reinstalled the core, the drivers with Zadig as it is written in the ReadMe.

When I press trhe RESET+BOOT buttons, Win10 shows it has found something, bu no COM port appears.
I can't get a COM port allocated to the boards in the Device Manager.
The STM32 BOOTLOADER exist in the Universal Serial Bus Devices category in Win10 Device manager.

image

Ladybug is working but it has a plain com port, no USB Device is appearing the same time.:

image

What happened? How can I fix it?

Thanks, Csaba

Arduino can't upload dfu

C:\Users\AppData\Local\Arduino15\packages\grumpyoldpizza\hardware\stm32l4\0.0.28/tools/windows/stm32l4-upload.bat 0x1209 0x6669 C:\Users\AppData\Local\Temp\arduino_build_69479/main_read_do.ino.dfu

An error occurred while uploading the sketch.

How to fix it?

Maximum I2C Clock

What's the maximum I2C clock rate supported by these boards? I see that the boards support up to 1 Mbit/s, but am wondering if the software supports that.

Thanks!
Brian

Serial Problem

Hi,
I am using your code as a base to get our module running. If you want, you can reimport our definitions. We'll sell it as a module including a LoRa interface once it's ready...
https://github.com/3s1d/arduino-STM32L4

I have a problem regarding the serial port. If I am doing:
Serial1.println("lala") then it boils down to: Serial.print("lala") + Serial.println()
The last call always will fail because this call in write() is true:
if (_uart->state != UART_STATE_READY)
As an quick work around (and because I don't understand your code fully) I quickly come up with that workaround:
https://github.com/3s1d/arduino-STM32L4/commit/4f42d62123788df102bff0fde4237ff0ddfdff3d#diff-82edf5670bbf6621faddb536b80d6cbf
But there must be a better solution to it.

Secondly: Can I enable the TX DMA Mode on my variant.cpp
https://github.com/3s1d/arduino-STM32L4/commit/4f42d62123788df102bff0fde4237ff0ddfdff3d#diff-96ee7d0ff43e5f3994ab4332f8e15380
It works, but not sure whether this has an effect on the system at all or if I am using some otherwise occupied hardware?

Many thanks in advance!
Juergen

How to use Serial1 or Serial2 on STM32 L476RG board using GrumpyOldPizza arduino-STM32L4 core

Hi,

I need to use NEO- 6M GPS with my STM32 L476RG. I tried to use TinyGPS++.h but it requires SoftwareSerial.h which does not work on 80 MHz boards. Hence I have to use Serial1 as mentioned in:
http://stm32duino.com/viewtopic.php?t=1959
But the problem is the code that is posted in the above link works for STM32DUINO core (https://github.com/stm32duino/Arduino_Core_STM32) but not on the GrumpyOldPizza core. In GrumpyOldPizza core, Serial1 does not work. Please help me out @GrumpyOldPizza and let me know how to make Serial1 work on GrumpyOldPizza core??

Thanks,
Mayukh,
IIT Delhi, India

After SPI.end() it's not possible to re-enable SPI with SPI.begin()

Short version: I think stm32l4_spi_disable() should set spi->state to SPI_STATE_INIT instead of SPI_STATE_NONE.

Long version: I've built a package which extends your arduino-STM32L4 platform to support the myStorm BlackIce, an open source board combining a STM32L433 with a Lattice ICE40 FPGA. Thanks to your wonderful work which has done all the heavy lifting for STM32L4, the myStorm package only needs to add a couple of board variant files, and a small library to assist with access to the FPGA.

On the BlackIce, the SPI pins used to configure circuit bitstreams into the FPGA are also multiplexed for other uses (eg driving a set of on-board LEDs). Therefore it would be useful to be able to call SPI.end(), reconfigure the SPI pins for GPIO, and then later call SPI.begin() to reclaim the pins for SPI use again. Unfortunately this doesn't work because stm32l4_spi_disable doesn't leave spi->state with the value stm32l4_spi_enable expects. With the change I've suggested above, it does work ... and this is consistent with some of the other drivers (eg i2c, uart) where the xxx_disable() routine leaves the device in INIT state.

Implementing DMA for DAC

So it seems that calls to the DAC take quite a bit of time so I would like to implement DMA transfers.

I tried my hand to use your DMA library but I cant seem to get it to fire. My code will complile but nothing happens :/

DMA feeding DAC code:

#include "stm32l4_dma.h"

stm32l4_dma_t stm32l4_DAC_DMA;

static int DACresolution = 12;

uint32_t i;

uint32_t DAC_DMA_OPTION = DMA_OPTION_MEMORY_TO_PERIPHERAL |
                          DMA_OPTION_PERIPHERAL_DATA_SIZE_32 |
                          DMA_OPTION_MEMORY_DATA_SIZE_32 |
                          DMA_OPTION_MEMORY_DATA_INCREMENT |
                          DMA_OPTION_PRIORITY_MEDIUM ;

void setup() {
  Serial.begin(9600);
  while (!Serial) {}
  analogWriteResolution(DACresolution);
  analogWrite(PIN_DAC0, i);
  analogWrite(PIN_DAC1, i);

  DAC->CR = (uint32_t) DAC->CR | 0x3000; //enable DAC DMA and underrun

  stm32l4_dma_create(&stm32l4_DAC_DMA, DMA_CHANNEL_DMA1_CH3_DAC1, DMA_OPTION_PRIORITY_LOW);
  stm32l4_dma_enable(&stm32l4_DAC_DMA, NULL, NULL);
}

void loop() {
  i = (i + 64) & DAC_DHR12R1_DACC1DHR;

  stm32l4_dma_start(&stm32l4_DAC_DMA, (uint32_t)&DAC->DHR12R1,(uint32_t)i, 1, DAC_DMA_OPTION);    //This should trigger a DMA trandfer to the DAC->DHR12R1 register.
 
}

Method to check for USB_VBUS

Is there a method to check for USB_VBUS?

I see it is tied to GPIO_PIN_PB2.
I tried to read pin 27 but it just returns false.

My intention is to shutdown the device when USB is not connected.

recursive file listing is hard (feature request)

It would be very helpful if the Dir class (in FS.h) has a method that tells you if the current entry is a directory. It would make it much easier to do recursive file scans.

Suggested implementation:
bool isdir() const { return _find.attr & F_ATTR_DIR; }

Problem with external RTC on STM32L476RG board

Dear Thomas/Kris,

@GrumpyOldPizza @kriswiner
As you know STM32L476RG board has RTC but it is not connected to a Battery. Hence I would like to use an external RTC like ds1307. But when I use DS1307 (I2C address= 0x68) , the usual Arduino libraries like RTCLib are giving output as:

2165/165/165 (Tuesday) 165:165:85
since midnight 1/1/1970 = 2275406289s = 26335d
now + 7d + 30s: 2042/2/15 5:48:15

The same code is running properly when I connect the DS1307 to Arduino board.
Any solution for this will be of much help...

Thanks,
Mayukh

I2C issue

Dear Kris & Thomas,
I have a limited experience in Atmel AVR, ESP32, chipkit PIC development, mainly Arduino, some MPXlab, Atmelstudio + Atmel-ICE platforms. I like Arduino, because of simplicity.

I am kickstarting in STM32 on your platform.
Blink was working on Ladybug, Butterfly and Dragonfly, The Cricket and SensorTile not yet arrived.
Now starting my Sensor-node development experiment, I run in the first barrier:

image

I2c not working.
I can't find the core library like with ESP32.
Anyway I am not expert in this kind of issues.

Please give my some directions to enter stm32l4 arduino world.

Thanks: Csaba Toth
.

Butterfly alternate SDA/SCL

The Butterfly pinout indicates that PB8/9 can be used as alternate pins for I2C. It also seems like that is indeed supported by stm32l4_i2c.c, but I can't find a way to enable that in Wire.h/Wire.cpp
(I need PB6/7 for touch sensing, which is why I want to use the alternate pins.)

PA15 state at reset? not input

@GrumpyOldPizza,

I'm using a dragonfly like board designed by Kris and we used PA15 as output to enable a LDO via an enable pin. We have placed a pull down on PA15 so at reset state the device behind LDO should be disabled.

unfortunately looks like reset state of this pin is not input and thus enable the LDO. Reconfiguring the PA15 pin as input in setup() solved the issue but wondering why and where this pin could be setup elsewhere not to be an input?

Can we easily fix?

of course our variant does not define PA15 as VUSB.

#define STM32L4_CONFIG_USB_VBUS           GPIO_PIN_PA9
#define PIN_USB_VBUS        (27ul)
#define PIN_USB_DM          (28ul)
#define PIN_USB_DP          (29ul)

/ 27..29 - USB (VBUS,DM,DP)
{ NULL,  GPIO_PIN_MASK(GPIO_PIN_PA9),  GPIO_PIN_PA9,            0,                                                              PWM_INSTANCE_NONE,  PWM_CHANNEL_NONE, ADC_INPUT_NONE },
{ NULL,  GPIO_PIN_MASK(GPIO_PIN_PA11), GPIO_PIN_PA11,           0,                                                              PWM_INSTANCE_NONE,  PWM_CHANNEL_NONE, ADC_INPUT_NONE },
{ NULL,  GPIO_PIN_MASK(GPIO_PIN_PA12), GPIO_PIN_PA12,           0,                                                              PWM_INSTANCE_NONE,  PWM_CHANNEL_NONE, ADC_INPUT_NONE },

Thanks

USB on PA11, PA12

Hi there,

thanks for all your hard work. Your library is the only way for me to use I2C on my Radino L4 board (http://wiki.in-circuit.de/index.php5?title=radinoL4_DW1000#Downloads)

The only thing I haven't managed yet, is connect to USB COM port. I can upload my sketches through DFU and they do seem to work, but I have no COM port appear in Windows device manager.

I think butterfly does not use PA11 and PA12 for USB communication, so it might be logical for it to not work. Is there any way to support the COM port for this board as well?

Using PA15 of LadyBug

I don't know if the question is for @kriswiner or @GrumpyOldPizza .

I would use the STM32L4 core to compile some code for a card which is really close to the Ladybug(L432KC microproc, dfu…). The main difference is that PA15 is route on a (nRF51)component, so I have to use it as an outpout.

My question is how or where make a change in variant.h to allow to use the PA15 pin in a sketch?

Thanks for your help.

Cédric

i dont even know what is wrong but here is the error

Arduino: 1.8.19 (Windows 10), Board: "NUCLEO-L432KC, 80 MHz, Smallest Code"

Sketch uses 116112 bytes (47%) of program storage space. Maximum is 245760 bytes.

Open On-Chip Debugger 0.10.0-dev-00272-gf17dc4a (2016-10-10-09:38)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

debug_level: 0

adapter speed: 500 kHz

adapter_nsrst_delay: 100

none separate

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

An error occurred while uploading the sketch

Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Error: init mode failed (unable to connect to the target)

in procedure 'program'

in procedure 'init' called at file "embedded:startup.tcl", line 473

in procedure 'ocd_bouncer'

** OpenOCD init failed **

shutdown command invoked

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.