Skip to content

Feature: Add support for load-native-lib on the VESC Express#69

Open
Relys wants to merge 1 commit intovedderb:mainfrom
Relys:feature-express-load-native-lib
Open

Feature: Add support for load-native-lib on the VESC Express#69
Relys wants to merge 1 commit intovedderb:mainfrom
Relys:feature-express-load-native-lib

Conversation

@Relys
Copy link
Contributor

@Relys Relys commented Sep 26, 2025

Support for load-native-lib on the VESC Express.

@IndianBoy42
Copy link

IndianBoy42 commented Oct 30, 2025

I would like to help test this as I plan to implement some heavy things in a vesc express, would it be enough to compile and flash the vesc express firmware or do I need a custom vesc firmware and vesc_tool too?

@Tomblarom
Copy link

Tomblarom commented Nov 2, 2025

hey @Relys, thanks for your PR! I'm working on some example lbm code for the ESP32-C3-DevKit and pulled your branch. However, when running the following snippet, I get an eval-error..

(import "pkg::ws2812@://vesc_packages/lib_ws2812/ws2812.vescpkg" 'ws2812)
(load-native-lib ws2812)
Preparing new image...
Parsing 98 characters
   Error: eval_error
   CTX: 408 "main-u"
   Current: ws2812
      bound to: [0 0 0 0 56 181 16 75 14 76 16 73 5 70 123 68 15 72 27 104 35 104 121 68 120 68 152 71 13 73 14 72 35 104 121 68 120 68 152 71 12 73 13 72 35 104 121 68 120 68 152 71 0 35 107 96 10 75 123 68 43 96 1 32 56 189 0 191 0 248 0 16 238 255 255 255 167 1 0 0 148�ý�j)�ßÂs_%��Ì¿u˾�ÒÂeDÑ�IÀ´[1�a
q-r½Ùª�(é�x�pÓ�>?�v$���ÄL=-�~Ú*%$��âíÜr-ñ:s?üd�kúçúk�Áâ(�U�GE<�Êd��§¥�tÇ:j�Ëô�´�Ókl,.L4��~«�
   In: load-native-lib

   Between row 2 and 2

eval_cps.c line number: 3454

I also tried compiling the ws2812.bin using cd /vesc_pkg/lib_ws2812/ && make and loading it, as you are showing here:

(import "ws2812.bin" 'ws2812-lib)
(load-native-lib ws2812-lib)

EDIT: Ok using the rgbled-* functions instead solved it.. :) Yet I can't explain, why it was not possible to use the ws2812-library.

@Relys
Copy link
Contributor Author

Relys commented Nov 5, 2025

hey @Relys, thanks for your PR! I'm working on some example lbm code for the ESP32-C3-DevKit and pulled your branch. However, when running the following snippet, I get an eval-error..

(import "pkg::ws2812@://vesc_packages/lib_ws2812/ws2812.vescpkg" 'ws2812)
(load-native-lib ws2812)
Preparing new image...
Parsing 98 characters
   Error: eval_error
   CTX: 408 "main-u"
   Current: ws2812
      bound to: [0 0 0 0 56 181 16 75 14 76 16 73 5 70 123 68 15 72 27 104 35 104 121 68 120 68 152 71 13 73 14 72 35 104 121 68 120 68 152 71 12 73 13 72 35 104 121 68 120 68 152 71 0 35 107 96 10 75 123 68 43 96 1 32 56 189 0 191 0 248 0 16 238 255 255 255 167 1 0 0 148�ý�j)�ßÂs_%��Ì¿u˾�ÒÂeDÑ�IÀ´[1�a
q-r½Ùª�(é�x�pÓ�>?�v$���ÄL=-�~Ú*%$��âíÜr-ñ:s?üd�kúçúk�Áâ(�U�GE<�Êd��§¥�tÇ:j�Ëô�´�Ókl,.L4��~«�
   In: load-native-lib

   Between row 2 and 2

eval_cps.c line number: 3454

I also tried compiling the ws2812.bin using cd /vesc_pkg/lib_ws2812/ && make and loading it, as you are showing here:

(import "ws2812.bin" 'ws2812-lib)
(load-native-lib ws2812-lib)

EDIT: Ok using the rgbled-* functions instead solved it.. :) Yet I can't explain, why it was not possible to use the ws2812-library.

You're trying to load shellcode compiled for an STM32 ARM Cortex on an ESP32 RISK V is why it won't work. The ws2812-lib is for STM32 only. Not only is ISA different but all the memory mappings, how DMA works, etc.

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