Skip to content

Add FOCSTrot V3/V4 to firmware package - #907

Open
bmyyqzs wants to merge 3 commits into
vedderb:masterfrom
bmyyqzs:add-focstrot-fw
Open

Add FOCSTrot V3/V4 to firmware package#907
bmyyqzs wants to merge 3 commits into
vedderb:masterfrom
bmyyqzs:add-focstrot-fw

Conversation

@bmyyqzs

@bmyyqzs bmyyqzs commented May 18, 2026

Copy link
Copy Markdown
Contributor

This adds FOCSTrot V3.0 and FOCSTrot V4.0 to package_firmware.py so they are included in the generated firmware archive used by VESC Tool Download Latest.

Validation performed:

  • python -m py_compile package_firmware.py
  • python package_firmware.py make_targets confirms FOCSTrot_V3 and FOCSTrot_V4 are included

Note: this Windows environment does not have make / arm-none-eabi-gcc installed, so full firmware compilation should be verified in the maintainer build environment.

After merge, please regenerate and publish res_fw_7.00.rcc so these firmwares appear in VESC Tool via Download Latest.

@surfdado

surfdado commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

this commit is missing the new hwconf source files, so this cannot work on its own - looks like you forgot this commit:

b038876 (origin/FOCSTrot_V3_V4) Add FOCSTrot V3 and V4 hardware support
| | hwconf/BMESC/hw_FOCSTrot_V3.h | 28 ++
| | hwconf/BMESC/hw_FOCSTrot_V4.h | 28 ++
| | hwconf/BMESC/hw_FOCSTrot_core.c | 245 ++++++++++++++++++
| | hwconf/BMESC/hw_FOCSTrot_core.h | 272 ++++++++++++++++++++
| | 4 files changed, 573 insertions(+)

@bmyyqzs

bmyyqzs commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

this commit is missing the new hwconf source files, so this cannot work on its own - looks like you forgot this commit:

b038876 (origin/FOCSTrot_V3_V4) Add FOCSTrot V3 and V4 hardware support | | hwconf/BMESC/hw_FOCSTrot_V3.h | 28 ++ | | hwconf/BMESC/hw_FOCSTrot_V4.h | 28 ++ | | hwconf/BMESC/hw_FOCSTrot_core.c | 245 ++++++++++++++++++ | | hwconf/BMESC/hw_FOCSTrot_core.h | 272 ++++++++++++++++++++ | | 4 files changed, 573 insertions(+)

I had adjusted FOCSTrot V3/V4 voltage and current limits.(12119ac)

@surfdado

Copy link
Copy Markdown
Contributor

Two problems here:
#1 (the critical problem) - your PR still only has two commits but it needs 3: Commit "Add FOCSTrot V3 and V4 hardware support" is the most important one yet you've not included it, or better: squash commit 1 and 3 into a single one
#2 (not critical but still needs fixing) - MCCONF_L_MIN_VOLTAGE and HW_LIM_VIN at 18.0V was just fine, no need to increase them unless your controller truly cannot function at 18V (e.g. when testing with a bench power supply)

I suggest you close this PR and open a fresh one. Might be easier.

@surfdado

Copy link
Copy Markdown
Contributor

Oh I'm sorry, I just see that branch release_7_00 already includes your original FOCstrot V3 and V4 commit, in that case you don't need to submit it again of course. My mistake. But I would still keep the minimum voltage at 18.0V for both controllers unless they cannot safely boot at 18 Volts.

@bmyyqzs

bmyyqzs commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Oh I'm sorry, I just see that branch release_7_00 already includes your original FOCstrot V3 and V4 commit, in that case you don't need to submit it again of course. My mistake. But I would still keep the minimum voltage at 18.0V for both controllers unless they cannot safely boot at 18 Volts.

Due to the hardware limitations of the device, it cannot power on at 18V. We have already conducted tests and confirmed this behavior.

@bmyyqzs

bmyyqzs commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Update on the latest commits:

  • Rebased the branch onto current master (merge commit), resolving the conflict in hw_FOCSTrot_core.h caused by the IMU config migration. The change is now expressed with the new-style macro #define IMU_BUS_SPEED_HZ 700000 alongside IMU_DEV/IMU_COM.
  • Regarding signal integrity at 700 kHz: the FOCSTrot hardware uses 1 kOhm pullups on the LSM6DS3 I2C lines, so the faster bus speed is safe — comparable to the ENNOID MK8 case (1.2 kOhm) in Enable 700 kHz I2C on more Onewheel-relevant controllers #923.

Both FOCSTrot_V3 and FOCSTrot_V4 build successfully with these changes, and the firmware binary confirms the 700 kHz / 1200 Hz sample-rate path is active.

@lukash lukash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not my repo but I'd personally ask to remove the unnecessary merge commit and the back and forth adding and removing the (AI-looking) comment. I'd suggest having one commit migrating the IMU macros to the new style and another commit adding the 700 khz speed line.

But Benjamin might be fine with the way it is. IMU-wise LGTM functionally.

Comment thread hwconf/BMESC/hw_FOCSTrot_core.h Outdated
// Run the IMU I2C bus at 700 kHz instead of 400 kHz (raises sample rate limit to 1200 Hz).
// Requires adequate SDA/SCL pullups (2.2-4.7 kOhm recommended); verify signal integrity on hardware.
#define LSM6DS3_SPEED_700KHZ
#define IMU_BUS_SPEED_HZ 700000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick (no need to address if you don't want to): Move the IMU_BUS_SPEED_HZ line below IMU_COM for consistency with the other hwconf files.

@lukash

lukash commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@bmyyqzs are you also involved in ADV500 development? Do you know what are the pullups there? I'm assuming the same as ADV200 but wanted to confirm. I'm sitting on a commit enabling 700 kHz there too, waiting for a response from Tony.

And do you know what is FOCSTrot V2 controller? Not part of the repo but it is shipping in the new Gosmilos it seems.

@bmyyqzs

bmyyqzs commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@bmyyqzs您也参与了 ADV500 的开发吗?您知道它的上拉电阻是多少吗?我猜和 ADV200 一样,但还是想确认一下。我提交了一个启用 700 kHz 的 commit,正在等 Tony 的回复。

你知道FOCSTrot V2控制器是什么吗?它不在代码库里,但似乎会在新版Gosmilos中发布。

Yes, I was involved in the ADV500 development. I can confirm that the IMU I²C pull-up resistors are the same as on the ADV200. They are 1 kΩ.
The FOCSTrot V2 and V3 controllers are hardware-wise very similar, and they use the same VESC firmware. The software is common to both versions.

@lukash

lukash commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Yes, I was involved in the ADV500 development. I can confirm that the IMU I²C pull-up resistors are the same as on the ADV200. They are 1 kΩ. The FOCSTrot V2 and V3 controllers are hardware-wise very similar, and they use the same VESC firmware. The software is common to both versions.

FWIW the new Gosmilos are shipping with a firmware that has "FOCSTrot V2" as HWNAME. This doesn't exist in upstream.

Occasionally people ask me questions about firmware for their boards or they ask for my custom Onewheel firmware build for their board (https://github.com/lukash/bldc/releases/, it's got some extra Onewheel-related improvements which weren't mainlined yet or can't be mainlined), I can't do anything for them if they have a firmware that's not in the tree.

Also, to make a point about the unnecessary merge commit in this PR, if I wanted to add support for FOCStrot V3/V4 in my 7.00-based release, I can't do it easily as I can't cherry-pick the merge commit (and I refuse to spend the extra work dealing with non-clean commits on principle).

@bmyyqzs

bmyyqzs commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Yes, I was involved in the ADV500 development. I can confirm that the IMU I²C pull-up resistors are the same as on the ADV200. They are 1 kΩ. The FOCSTrot V2 and V3 controllers are hardware-wise very similar, and they use the same VESC firmware. The software is common to both versions.

FWIW the new Gosmilos are shipping with a firmware that has "FOCSTrot V2" as HWNAME. This doesn't exist in upstream.

Occasionally people ask me questions about firmware for their boards or they ask for my custom Onewheel firmware build for their board (https://github.com/lukash/bldc/releases/, it's got some extra Onewheel-related improvements which weren't mainlined yet or can't be mainlined), I can't do anything for them if they have a firmware that's not in the tree.

Also, to make a point about the unnecessary merge commit in this PR, if I wanted to add support for FOCStrot V3/V4 in my 7.00-based release, I can't do it easily as I can't cherry-pick the merge commit (and I refuse to spend the extra work dealing with non-clean commits on principle).

Yes, I was involved in the ADV500 development. I can confirm that the IMU I²C pull-up resistors are the same as on the ADV200. They are 1 kΩ. The FOCSTrot V2 and V3 controllers are hardware-wise very similar, and they use the same VESC firmware. The software is common to both versions.

FWIW the new Gosmilos are shipping with a firmware that has "FOCSTrot V2" as HWNAME. This doesn't exist in upstream.

Occasionally people ask me questions about firmware for their boards or they ask for my custom Onewheel firmware build for their board (https://github.com/lukash/bldc/releases/, it's got some extra Onewheel-related improvements which weren't mainlined yet or can't be mainlined), I can't do anything for them if they have a firmware that's not in the tree.

Also, to make a point about the unnecessary merge commit in this PR, if I wanted to add support for FOCStrot V3/V4 in my 7.00-based release, I can't do it easily as I can't cherry-pick the merge commit (and I refuse to spend the extra work dealing with non-clean commits on principle).

Thanks for the feedback. I cleaned up the branch history and force-pushed the PR branch.

The unnecessary merge commit has been removed, and the IMU-related follow-up commits have been folded into a single clean commit. The PR now has only these three commits:

  1. Add FOCSTrot V3/V4 to firmware package
  2. Adjust FOCSTrot voltage and current limits
  3. FOCSTrot: Enable 700 kHz IMU I2C bus speed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants