Search found 147 matches

by danieleff
Sat Apr 29, 2017 3:21 am
Forum: CubeMX and HAL
Topic: [STM32GENERIC] I2C Examples
Replies: 11
Views: 110

Re: [STM32GENERIC] I2C Examples

For existing libraries that use hardcoded Wire:

Code: Select all

Wire.stm32SetInstance(I2Cx);
Wire.stm32SetSDA(sda);
Wire.stm32SetSCL(scl);
rtc....()
...

Or if you can rewrite the whole library, add a private TwoWire *wire, add a setter, and use that.
by danieleff
Fri Apr 28, 2017 4:18 pm
Forum: Cores
Topic: STM32GENERIC, my arduino implementation
Replies: 124
Views: 1348

Re: STM32GENERIC, my arduino implementation

There is no DMA yet. Probably should get its full topic.

There is a minimum SDIO, and SdFat-beta with SDIO in BoardExamples / Black 407VE
by danieleff
Fri Apr 28, 2017 4:05 pm
Forum: Cores
Topic: STM32GENERIC, my arduino implementation
Replies: 124
Views: 1348

Re: STM32GENERIC, my arduino implementation

Pito wrote:There is a bug/typo in SeriaUART.cpp line 44:

Code: Select all

     if (!static_rx_used) {
       txBuffer = (uint8_t*)rx;     <<<< shall be rxBuffer
        static_rx_used = true;
     } else {
       rxBuffer = (uint8_t*)malloc(BUFFER_SIZE);
     }
  }

Thanks, commited
by danieleff
Fri Apr 28, 2017 11:19 am
Forum: Cores
Topic: STM32GENERIC, my arduino implementation
Replies: 124
Views: 1348

Re: STM32GENERIC, my arduino implementation

Then I will change the menu on discovery407 to UART2 and somehow #undefine UART1 @zmemw16 I do not have all the boards, and time to go through every schematic. Currently all UARTs should be usable, on defaulted to the primary pin (the same CubeMX gives first if you enable). You can set alternate pin...
by danieleff
Fri Apr 28, 2017 4:57 am
Forum: Cores
Topic: STM32GENERIC, my arduino implementation
Replies: 124
Views: 1348

Re: STM32GENERIC, my arduino implementation

Seems like on discovery the PA9 (uart1 transmit) is connected to vbus? (UM1472 page 35) Here is the basic low level code for sending on UART2, PA2/PA3, just generated with CubeMX, if for some the SerialUARx does not work, could you try this: void setup() { __HAL_RCC_USART2_CLK_ENABLE(); __HAL_RCC_GP...
by danieleff
Thu Apr 27, 2017 5:37 pm
Forum: Cores
Topic: STM32GENERIC, my arduino implementation
Replies: 124
Views: 1348

Re: STM32GENERIC, my arduino implementation

So UART seems to not work for some? It should be either: A) select SerialUART in menu, then write Serial.begin(...); Serial.print(...) or B) Use SerialUARTx.begin(...); SerialUARTx.print(...) Could you try all SerialUART1, SerialUART2...? @michael_l: Currently if you #include "STM32_HAL.h"...
by danieleff
Thu Apr 27, 2017 3:20 pm
Forum: CubeMX and HAL
Topic: [STM32GENERIC] micros() bug??
Replies: 21
Views: 199

Re: [STM32GENERIC] micros() bug??

Libmaple also does this "check if millis changed" https://github.com/rogerclarkmelbourne/ ... time.h#L56

I will use your implementation if no better is found.
by danieleff
Thu Apr 27, 2017 12:52 pm
Forum: CubeMX and HAL
Topic: [STM32GENERIC] I2C Examples
Replies: 11
Views: 110

Re: [STM32GENERIC] I2C Examples

I2C Scanner code is the discovery scanner with their specific I2S stuff etc commented out i have a tmp102 and a 128x64 0.98 I2C oled SSD1306, with 4k7 pullups and 3v3 plugged in this is SERIALINTERFACE #defined as SerialUSB ... 0 Unknown error at address 0x3B 0 I2C device found at address 0x3C ! 0 ...
by danieleff
Wed Apr 26, 2017 7:00 pm
Forum: CubeMX and HAL
Topic: [STM32GENERIC] I2S implementation
Replies: 2
Views: 62

[STM32GENERIC] I2S implementation

The current implementation is in https://github.com/danieleff/STM32GENERIC/blob/master/STM32/libraries/I2S/src/I2S.cpp (not much...) The write() currently sends unsigned 16 bit data. I do now know what the official implementation for SAMD21 boards expects to send (signed/unsigned/what type of buffer...
by danieleff
Wed Apr 26, 2017 6:36 pm
Forum: CubeMX and HAL
Topic: [STM32GENERIC] micros() bug??
Replies: 21
Views: 199

Re: micros() bug??

I belive SysTick->VAL is counting down from SysTick->LOAD to 0.
So if you use `return (HAL_GetTick()*1000) + (SysTick->VAL / (SystemCoreClock / 1000000));`
and print

Code: Select all

Serial.println(micros());
Serial.println(micros());
delay(3000);

you will go back in time like Marty McFly

Go to advanced search