eferu / hoverboard-sideboard-hack-stm Goto Github PK
View Code? Open in Web Editor NEWHoverboard sideboard hack for STM32 boards
License: GNU General Public License v3.0
Hoverboard sideboard hack for STM32 boards
License: GNU General Public License v3.0
The read from I2C never times out when there is an issue.
Looks like a known bug for STM32
https://community.st.com/s/question/0D53W000007Wj9wSAC/hali2c-hangs-when-it-enters-i2cwaitonflaguntiltimeout-function
The Systick priority is lower than the USART interrupt and the clock doesn't advance to create the timeout.
static HAL_StatusTypeDef I2C_WaitOnFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Flag, FlagStatus Status, uint32_t Timeout, uint32_t Tickstart)
{
/* Wait until flag is set */
while (__HAL_I2C_GET_FLAG(hi2c, Flag) == Status)
{
/* Check for the Timeout */
if (Timeout != HAL_MAX_DELAY)
{
if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U))
The above code in stm32f1xx_hal_i2c.c never times out
I tried to increase the priority of the systick handler.
No result so far.
Hello,
how do i change the code to use the sideboard standing | instead of lying __ (regarding to MPU6050 chip orientation)?
I found following piece of code in MPU6050.c Line 55:
static signed char MPU_ORIENTATION[9] = {1, 0, 0, // [-] MPU Sensor orientation matrix: set this according to the sensor installation 0, 1, 0, 0, 0, 1};
but find nowhere a definition or tutorial what i need to change.
Also is in the MPU6050 part no function to set the offsets? found nothing useful until yet.
BTW: I think the processing example in the end of the Readme is broken ;)
It worked for me after i changed the array indexes from 2, 4, 6 to 1, 3, 5 (https://github.com/EFeru/hoverboard-sideboard-hack-STM/blob/master/docs/sketch_processing/sketch_processing.pde line 86++)
Hi
I am trying to get dual inputs working > https://github.com/EFeru/hoverboard-firmware-hack-FOC/issues/242
So now I am at "Serial + Side board "attempt:
1 Checked wiring polarity and unlocked with Cubeprogrammer
2 Flashed VARIANT_HOVERCAR to side-board (to use RC receiver and later incorporate mpu for acceleration)
3 Flashed main-board with VARIANT USART:
This is gonfig.h on main-board
`#ifdef VARIANT_USART
#define SIDEBOARD_SERIAL_USART2 0
//#define CONTROL_SERIAL_USART2 0 // left sensor board cable, disable if ADC....
//#define FEEDBACK_SERIAL_USART2 // left sensor board cable, disable if ADC or PPM is used! tk
// #define SIDEBOARD_SERIAL_USART3 0
#define CONTROL_SERIAL_USART3 1 // right sensor board cable. Number indicates priority.......
#define FEEDBACK_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuk or lcd) is used!
#define DUAL_INPUTS // UART*(Primary) + SIDEBOARD(Auxiliary). Uncomment this to use Dual-inputs
#define PRI_INPUT1 3, -1000, 0, 1000, 0 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section
#define PRI_INPUT2 3, -1000, 0, 1000, 0 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section
#ifdef DUAL_INPUTS
#define FLASH_WRITE_KEY 0x1102 // Flash memory writing key. Change this k.........
#define SIDEBOARD_SERIAL_USART2 0 // left sideboard
//#define SIDEBOARD_SERIAL_USART3 1 // right sideboard
//#define CONTROL_SERIAL_USART3 1 //tk added
#define AUX_INPUT1 3, -1000, 0, 1000, 0 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section
#define AUX_INPUT2 3, -1000, 0, 1000, 0 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section
#else
#define FLASH_WRITE_KEY 0x1002 // Flash memory writing key. Change thi.........
#endif
// #define SUPPORT_BUTTONS_LEFT // use left sensor board cable for button inputs. Disable DEBUG_SERIAL_USART2!
// #define SUPPORT_BUTTONS_RIGHT // use right sensor board cable for button inputs. Disable DEBUG_SERIAL_USART3!
#endif
// ######################## END OF VARIANT_USART SETTINGS #########################`
All I am getting is Serial on right cable > working(tested with Arduino)
but side-board left cable nothing(don't know how to check side-board function)
Note: STM32F103C8T6
Connected RC receiver : picked 5v and ground from board and USARTT1_RX connected straight to IBUS on receiver
Whats the recommended resistor for?
Thanks for your github sources and documentation ! Well done.
Just tried to program one of the sideboards with an stlink V2, while connecting the 3.3V connection on the SWD pinout. , and was able to remove the protection, but not able to program. Afterwards it became unvisible to the stlink programmer.
I suspect that the 3.3V goes through the CPU and leaks back to the 5V where there is much more passive load. I'm guessing this leakage current killed the CPU.
Luckily I have another board and tried with the 5V supply of the STLINK connecting to the RF +5V , this worked fine.
Maybe adapt the README.MD in that sense ?
I saw also for the mainboard on other pages, it's not recommended to program just supplying the 3.3V
Hope this makes sense.
Is there a way to control the LEDs. It would be nice to make them blink when going forward and turn on when in reverse.
So far I only see my LEDs turn on when I turn on the car.
Hi,
I've just exploded a 5V regulator and possibly a full sideboard while trying to test my very basic firmware : I only conencted +12V according to the schematics in the README.md.
On my board ground is on the gyroscope side and +12V on the ARM proc side.
(By the way mine is a GD32 while having the STM32 card layout...)
Thanks for your job !
Hi.
While I am uploading firmware I get a error. Why does it happen?
Executing task: C:\Users\TOLGA.platformio\penv\Scripts\platformio.exe run --target upload <
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F103C8.html
PLATFORM: ST STM32 6.1.0 > STM32F103C8 (20k RAM. 64k Flash)
HARDWARE: STM32F103C8T6 72MHz, 20KB RAM, 64KB Flash
DEBUG: Current (stlink) External (blackmagic, jlink, stlink)
PACKAGES:
hla_swd
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
Warn : no flash bank found for address 0x08008000
Warn : no flash bank found for address 0x08008674
** Programming Finished **
** Verify Started **
Error: timed out while waiting for target halted
Error: error executing cortex_m crc algorithm
embedded:startup.tcl:449: Error: ** Verify Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 494
at file "embedded:startup.tcl", line 449
*** [upload] Error 1
========================================================== [FAILED] Took 29.03 seconds ==========================================================
Environment Status Duration
VARIANT_DEBUG IGNORED
VARIANT_HOVERBOARD FAILED 00:00:29.032
===================================================== 1 failed, 0 succeeded in 00:00:29.032 =====================================================
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
i really like the feature on the hovercar to have the led as battery indicator and show the board is on. i am now trying to setup a nunchuk project. it doesnt look like the nunchuk variant is supported on the sideboard. is there an easy way to modify the config file to just use the led as battery indicator like on the hovercar variant and connect to my nunchuk flashed mainboard?
Can this side panel support PWM? Or can it be updated to support PWM?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.