Arduino-proffieboard plugin 4.6 beta

Ok, it’s time to move v4.6 of the arduino-proffieboard plugin to beta.

Changes Include:

  • Updated compiler: arm-gcc 14.2
  • Serial interrupt priority fix.
  • added menu for changing pclk, allows for 40Mhz SPI
  • Support for output-only SPI
  • SPI3 dma fix on V3 boards (collides with audio dma)

Most of these changes will be completely invisible unless you are trying out the new color display stuff in ProffieOS 8.

To install this version, you need to add the following URL to the board manager URLs in Arduino:

https://profezzorn.github.io/arduino-proffieboard/package_proffieboard_beta_index.json

After that you should be able to install the arduino-proffieboard using the board manager. Please note that you need Arduino 2.x to install this plugin, but it should work with Arduino 1.x once installed. If you keep the regular ProffieOS url in the URL manager, you can also have both versions installed at the same time.

To help with testing, the best thing is to use a saber that already works, and that you know well how it works. Then compile the code for that saber with the new arduino-proffieboard plugin with no changes. Then try out the saber and make sure it works the same. If anything has changed, please report it in this thread and I will investigate. If nothing has changed, please report that too. Make sure to post what version of proffieOS you used, what version of Arduino, what operating system (mac/windows) and if your saber has any special features, like oled displays, bluetooth modules, rocket boosters, etc. The more special features we get tested, the less likely it is that we will have surprises in the future.

My goal is to have at least 10 tests (in addition to the ones we’ve already when 4.6 was in experimental/alpha.)

Well not good for me.
MacOS 15.2, M4.
I used Arduino 2.3.4 to install 4.6 beta.
After, I quit and re-opened 1.18.9 and uploaded with a Proffieboard V2 connected.
When done, Serial monitor wasn’t opening. I let it wait and eventually it opened, but nothing inside, and very laggy (Arduino froze). I force quit that and opened Arduino 2.3.4.
Again, it sees the board on the port, however the Serial Monitor portion of the window reports:

“Timeout. The IDE has not received the ‘success’ message from the monitor after successfully connecting to it. Could not connect to /dev/cu.usbmodem205E35654E321 serial port.”

So I tried uploading, and after compiling successfully, it got stuck uploading, then eventually gave a 10-1 countdown.
Went back to Arduino 1.18.9, chose 3.6 plugin, but again, it can’t talk to the board even though it’s there on PORT.
Forced BOOTLOADER mode and upload to finally recover. Phew.

Well that doesn’t sound good.
It’s also quite weird.

Some questions:

  • what version of ProffieOS?
  • Can you post your config file? (Or a complete copy of ProffieOS if you have local modifications.)
  • What settings did you have in Arduino->Tools? (usb type? optimizations? pclk?)

Also, I seem to recall you trying v4.4 earlier on this machine and saying it worked fine. v4.4 and v4.6 is the same compiler, the only difference is in how the compiler was compiled… (I’m asking because I’m trying to figure out what went differently this time from the last time, as that may be a clue as to what is going wrong.)

I ran a test with:

  • Arduino 2.3.4
  • Arduino-proffieboard v4.6
  • Mac M3 max
  • ProffieOS 7.14
  • default_proffieos_config.h
  • Proffieboard V2

It did not produce any problems with the serial monitor.
It’s not an installed Proffieboard so I wasn’t able to do a full test, just list some files on the sd card.

I was running the GItHub master. I’ll be able to thoroughly test tomorrow.

I had tested on an uninstalled board when I was having the issue above.
So I tried on a board in a saber and it seems fine.
I thought it weird that it would be board specific, so I tried another uninstalled board… same problem. Board freezing up. hmmm.

So I put it on my Proffie Testbed to see if I could hear anything when a speaker is hooked up and sure enough:
“Error in fonSQUEEEEEEEEEEEE”.
Over and over reproducible.
Then I tried removing the SD card from the “working” board in the saber and it also does squee of death when no SD inserted.
So there it is.
Inserting an SD into the “broken” boards and the problem went away.
No SD card inserted causes the freeze.

And this only happens with v4.6?

As opposed to 3.6, yes.
I didn’t try any intermediary versions during this testing.
3.6 allows Serial Monitor to show “Failed to mount SD” or whatever it says, and speaks all the errors straight through. The board then continues to run fine without a card in.

I’ll see if I can figure out why.
I actually hope it’s a bug in ProffieOS rather than a compiler bug this time…

My first attempt to replicate this problem did not produce a crash.
Can you tell me what settings you are using in Arduino->Tools and post your config file?
Also, were all of these crashes while connected to a mac, or did you get crashes on battery power too?

Sigh. Well as gremlins go, I can not reproduce this now for some reason. Nothing has changed . I only put my display to sleep and came back to the same setup.

Today: The V2.2 board on the test bench was still doing the same as I last left it, “Font direSQUEEEEE” when powered up by either USB or battery when no SD card inserted.
I re-uploaded with 4.6 plugin and now it’s fine.
I tried 2 other boards, one installed , one loose. all seem fine now.
Arduino 1.8.19 the whole time.
Tried both Serial only as well as Serial + Mass Storage. No difference, still fine now.
DOSFS: SPI
Optimize: Smallest Code
Periphereal Clock: Half

No idea.

Funky.
The only explanation I can think of that fits would be if some parts of the compiler is not deterministic and genreates slightly different code each time you run it, and some of the time it generates code that has this bug for some reason.

Here’s the test config FWIW, used with Github master ProffieOS.

// BC_Ronin_8.x

#ifdef CONFIG_TOP
#include "proffieboard_v2_config.h"
#define NUM_BUTTONS 1
#define NUM_BLADES 1

// ------ Audio Stuff --------

#define VOLUME 2000
#define BOOT_VOLUME 200
#define FILTER_CUTOFF_FREQUENCY 100
//#define FILTER_ORDER 8  // default is 8

// ------ Blade Stuff ------

const unsigned int maxLedsPerStrip = 144;
#define EXTRA_COLOR_BUFFER_SPACE 30

// BridgedPullupBladeID is the default Proffieboard V3 BLADE_ID_CLASS, so it doesn't need to defined explicitly with a V3.
#define BLADE_ID_CLASS BridgedPullupBladeID<bladeIdentifyPin, 9> // PBv2.2 TX pad for example

                //    Use with Blade ID. Specify the LED pad(s) that the main blade uses.
                  #define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>

                //    Required when blades on different data pads use common LED power pads.
                //    and/or when BLADE_ID_SCAN_MILLIS is used with Blade ID.
                  #define SHARED_POWER_PINS

                //    Choose how often to check for new blade (milliseconds).
                //    Larger values will be a longer delay before a blade is recognized.
                 #define BLADE_ID_SCAN_MILLIS 1000

                //    How many Blade ID scans to average (default is 10, works well)
                 #define BLADE_ID_TIMES 15

                #define NO_BLADE_ID_RANGE 15000,99999999


// To be able to edit blade length on the saber via a menu, use the following define:
#define DYNAMIC_BLADE_LENGTH

// ------ SD Card Stuff -------

#define MOUNT_SD_SETTING

//#define SAVE_STATE
    // #define SAVE_VOLUME
    #define SAVE_PRESET
    #define SAVE_COLOR_CHANGE

// ------ System Stuff --------

 //#define ENABLE_DEBUG
   // PVLOG_ERROR 100 = errors
   // PVLOG_STATUS 200 = things you should probably know, like blade ID
   // PVLOG_NORMAL 300 = normal information about what is happening (default level)
   // PVLOG_DEBUG 400 = information helpful for debugging
   // PVLOG_VERBOSE 500 = repeated, spammy information you don't normally want
#define PROFFIEOS_LOG_LEVEL 300
#define DISABLE_BASIC_PARSER_STYLES
#define IDLE_OFF_TIME 10000
#define MOTION_TIMEOUT 60 * 5 * 1000

// Give serial monitor a chance to catchup at boot,
// and/or for waiting until speaker pod is connected on certain chassis etc...
#define CONFIG_STARTUP_DELAY 1000

// ------- Motion and Gesture stuff -------

#define CLASH_THRESHOLD_G 3.5
#define ENABLE_SPINS

// -------- BC prop stuff --------

#define BC_SWING_ON
#define BC_SWING_ON_SPEED 400 // Default 250
#define BC_THRUST_ON
#define BC_TWIST_ON
#define BC_TWIST_OFF
#define BC_FORCE_PUSH
#define BC_FORCE_PUSH_LENGTH 5
#define BC_ENABLE_AUTO_SWING_BLAST  // BC Multiblast continues as long as swinging within 1 second. 
#define BC_LOCKUP_DELAY 200

// -------- BC Prop Other Stuff --------

// As of OS8, the default for the BC_buttons prop file are volume level and blade length edit menus.
// A System Menu is available to edit presets, colors settings, and more. To use this menu system instead, use the following define:
 #define MENU_SPEC_TEMPLATE DefaultMenuSpec

#endif

#ifdef CONFIG_PROP
#include "../props/saber_BC_buttons.h"
#endif

#ifdef CONFIG_PRESETS
#include "aliases/TrueWhites/BC_effects_1.h"                 // For Red, Green, light Blue, ...light colored blades
#include "aliases/TrueWhites/BC_effects_Red.h"               // For Red or dark blades
#include "aliases/TrueWhites/BC_effects_White.h"             // For White blades

using OnDemandVolumeLevel = TransitionEffectL<TrConcat<TrSmoothFade<200>,AlphaL<Gradient<Blue,Green>,SmoothStep<VolumeLevel,Int<-1>>>,TrDelay<1000>,TrSmoothFade<500>>,EFFECT_VOLUME_LEVEL>;
using OnDemandBatteryLevel = AlphaL<TransitionEffectL<TrConcat<TrSmoothFade<500>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<Scale<BatteryLevel,Int<0>,Int<35000>>,Int<-1>>>,TrDelay<1000>,TrSmoothFade<1000>>,EFFECT_BATTERY_LEVEL>,Ifon<Int<0>,Int<32768>>>;


Preset noblade [] = {

{ "aa_Kyberphonic/The_Duel/Ronin;ProffieOS_V2_Voicepack_The_Ronin/common;commonBU", "The_Duel/tracks/track2.wav",
  StylePtr<Layers<
    Yellow,
    InOutTrL<TrWipe<300>,TrWipeIn<500>>,
    TransitionEffectL<TrConcat<TrInstant,White,TrDelay<25>,AlphaL<White,Bump<Int<0>>>,TrFade<200>,AlphaL<HumpFlicker<White,Black,50>,LinearSectionF<Scale<Trigger<EFFECT_PREON,Int<500>,Int<1000>,Int<1>,Int<200>>,Int<-5000>,Int<37728>>,Int<10000>>>,TrDelay<1000>>,EFFECT_PREON>,
    TransitionEffectL<TrConcat<TrDelay<400>,TrJoin<TrConcat<TrWipe<500>,AlphaL<BrownNoiseFlicker<Yellow,Black,500>,SmoothStep<Int<7000>,Int<-12000>>>,TrDelay<4500>>,TrSparkX<HumpFlicker<Yellow,Black,50>,Int<400>,Int<250>,Int<0>>>,TrInstant>,EFFECT_PREON>,
    TransitionEffectL<TrConcat<TrDelay<700>,TrSparkX<BrownNoiseFlicker<Yellow,Black,500>,Int<400>,Int<400>,Int<32768>>,TrDelay<150>,TrSparkX<BrownNoiseFlicker<Yellow,Black,500>,Int<400>,Int<400>,Int<32768>>,TrDelay<150>,TrSparkX<BrownNoiseFlicker<Yellow,Black,500>,Int<400>,Int<400>,Int<32768>>,TrDelay<500>,TrSparkX<BrownNoiseFlicker<Yellow,Black,500>,Int<400>,Int<400>,Int<32768>>,TrDelay<150>,TrSparkX<BrownNoiseFlicker<Yellow,Black,500>,Int<400>,Int<400>,Int<32768>>,TrDelay<150>,TrSparkX<BrownNoiseFlicker<Yellow,Black,500>,Int<400>,Int<400>,Int<32768>>,TrDelay<150>,TrSparkX<BrownNoiseFlicker<Yellow,Black,500>,Int<400>,Int<400>,Int<32768>>,TrInstant>,EFFECT_PREON>,
    TransitionEffectL<TrConcat<TrDelay<1100>,AlphaL<HumpFlicker<White,Black,200>,LinearSectionF<Int<1638>,Int<3277>>>,TrDelay<550>,AlphaL<HumpFlicker<White,Black,200>,LayerFunctions<LinearSectionF<Int<1638>,Int<3277>>,LinearSectionF<Int<6553>,Int<3277>>>>,TrDelay<550>,AlphaL<HumpFlicker<White,Black,200>,LayerFunctions<LinearSectionF<Int<1638>,Int<3277>>,LinearSectionF<Int<6553>,Int<3277>>,LinearSectionF<Int<11466>,Int<3277>>>>,TrDelay<850>,AlphaL<HumpFlicker<White,Black,200>,LayerFunctions<LinearSectionF<Int<1638>,Int<3277>>,LinearSectionF<Int<6553>,Int<3277>>,LinearSectionF<Int<11466>,Int<3277>>,LinearSectionF<Int<16379>,Int<3277>>>>,TrDelay<550>,AlphaL<HumpFlicker<White,Black,200>,LayerFunctions<LinearSectionF<Int<1638>,Int<3277>>,LinearSectionF<Int<6553>,Int<3277>>,LinearSectionF<Int<11466>,Int<3277>>,LinearSectionF<Int<16379>,Int<3277>>,LinearSectionF<Int<21292>,Int<3277>>>>,TrDelay<550>,AlphaL<HumpFlicker<White,Black,200>,LayerFunctions<LinearSectionF<Int<1638>,Int<3277>>,LinearSectionF<Int<6553>,Int<3277>>,LinearSectionF<Int<11466>,Int<3277>>,LinearSectionF<Int<16379>,Int<3277>>,LinearSectionF<Int<21292>,Int<3277>>,LinearSectionF<Int<26205>,Int<3277>>>>,TrDelay<550>,AlphaL<HumpFlicker<White,Black,200>,LayerFunctions<LinearSectionF<Int<1638>,Int<3277>>,LinearSectionF<Int<6553>,Int<3277>>,LinearSectionF<Int<11466>,Int<3277>>,LinearSectionF<Int<16379>,Int<3277>>,LinearSectionF<Int<21292>,Int<3277>>,LinearSectionF<Int<26205>,Int<3277>>,LinearSectionF<Int<31118>,Int<3277>>>>,TrFade<700>,BrownNoiseFlicker<Yellow,Black,500>,TrInstant>,EFFECT_PREON>,
    TransitionEffectL<TrConcat<TrDelay<4900>,TrFade<900>,HumpFlicker<White,Black,50>,TrInstant,Black,TrDelay<125>,White,TrDelay<25>>,EFFECT_PREON>
  >>(),
"the\nduel"},

};

Preset light [] = {

{ "aa_JayDalorian/Nexus;ProffieOS_V2_Voicepack_The_Ronin/common;commonBU", "", // Ice Stab and scanning Force
  StylePtr<Layers<
    StripesX<Int<1500>,Scale<SlowNoise<Int<2500>>,Int<-3000>,Int<-5000>>,RotateColorsX<Variation,Rgb<95,0,210>>,RotateColorsX<Variation,Rgb<30,0,66>>,RotateColorsX<Variation,Rgb<95,0,210>>,RotateColorsX<Variation,Rgb<7,0,16>>,RotateColorsX<Variation,Rgb<95,0,210>>>,
    BC_effects_White,
    TransitionEffectL<TrConcat<TrFade<400>,RotateColorsX<Variation,Rgb<160,60,255>>,TrDelay<7000>,RotateColorsX<Variation,Rgb<160,60,255>>,TrFade<800>>,EFFECT_FORCE>,
    TransitionEffectL<TrConcat<TrInstant,AlphaL<Stripes<10,-1600,Mix<Sin<Int<30>>,White,Black>,Mix<Sin<Int<30>>,White,Black>,Mix<Sin<Int<24>>,Green,White>>,Bump<Scale<Sin<Int<40>>,Int<1000>,Int<34000>>,Int<20000>>>,TrDelay<7000>>,EFFECT_FORCE>,
    TransitionEffectL<TrConcat<TrFade<3000>,RotateColorsX<Variation,Rgb<95,0,210>>,TrDelay<5000>,RotateColorsX<Variation,Rgb<95,0,210>>,TrFade<3000>>,EFFECT_STAB>,
    TransitionEffectL<TrConcat<TrWipe<3000>,TransitionEffect<Stripes<10000,-1000,Rgb<50,75,165>,Rgb<25,37,82>,Rgb<50,75,165>,Rgb<13,19,41>>,Rgb<100,150,230>,TrFade<3000>,TrDelay<3000>,EFFECT_STAB>,TrDelay<3000>,Rgb<100,150,230>,TrWipe<3000>>,EFFECT_STAB>,
    TransitionEffectL<TrConcat<TrWaveX<BrownNoiseFlicker<White,SteelBlue,60>,Int<3000>,Int<400>,Int<3000>,Int<0>>,AlphaL<White,Int<0>>,TrDelay<3000>,AlphaL<White,Int<0>>,TrWaveX<BrownNoiseFlicker<DarkOrange,Yellow,80>,Int<10000>,Int<400>,Int<3000>,Int<0>>>,EFFECT_STAB>,
    InOutTrL<TrJoin<TrWipeX<BendTimePowInvX<Int<1500>,Int<135000>>>,TrSparkX<Rgb<100,100,255>,Int<400>,BendTimePowInvX<Int<1500>,Int<110000>>,Int<1600>>>,TrJoin<TrWipeInX<BendTimePowX<WavLen<EFFECT_RETRACTION>,Int<180000>>>,TrSparkX<Rgb<100,100,255>,Int<400>,BendTimePowX<WavLen<EFFECT_RETRACTION>,Int<180000>>,Int<32768>>>>,
    TransitionEffectL<TrConcat<TrDelay<300>,AlphaL<RandomPerLEDFlickerL<White>,SmoothStep<Int<6000>,Int<-4000>>>,TrDelayX<WavNum<EFFECT_PREON>>>,EFFECT_PREON>,
    TransitionEffectL<TrConcat<TrColorCycle<1000,0>,GhostWhite,TrFade<100>>,EFFECT_PREON>,
  // On-Demand
    OnDemandVolumeLevel,
    OnDemandBatteryLevel
  >>(),
"nexus"},

};

Preset dark [] = {

{ "a_BAYLAN_SKOLL/Skoll;ProffieOS_V2_Voicepack_Skoll/common;commonBU", "a_BAYLAN_SKOLL/Skoll/tracks/track1.wav",
  StylePtr<ColorChange<TrInstant,Red,Green,Blue,Yellow,White,Black,AudioFlicker<Rgb<200,200,0>,Rgb<20,20,0>>>>(),
"baylan\nskoll"},

};


BladeConfig blades[] = {

{ NO_BLADE,
  WS281XBladePtr<8, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
  CONFIGARRAY(noblade),
"00_noblade_save"},

{ 64000,
  WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
  CONFIGARRAY(light),
"01_light_save"},


{ 6400,
  WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
  CONFIGARRAY(dark),
"01_dark_save"},

};
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow"); 
Button AuxButton(BUTTON_AUX, auxPin, "aux");
#endif

I’ll try this config and see if it brings out any problems on my end.
In the meantime, I think we just need more testing from more people.
Maybe this was a one-time weirness, or maybe it’s a widespread problem… Not sure we can find out without more testing.

It seems to me that the amount of traffic on The Crucible is pretty low/slow (no offense intended). It might be a good idea to “advertise” the request for testers on the Proffie Facebook & Reddit groups ?

With your permission, I don’t mind posting on Reddit, I am just not sure what to say?

none taken

I already posted it on two facebook groups. Although my last couple of posts in those groups have gone entirely without any sort of reaction, which makes me think that those groups might get even less traffic than The Cruicible. (Or people’s attention span has now shrunk below planck time, and is thus not measurable anymore.)

Feel free to post other places, just remember that any feedback we get in those places will not automatically make it back to me…

Maybe another suggestion: I know some people are shy, can “non members” post here as “guest”, or could that be setup ? If I get any reply, I will link it here.

no, they cannot

I don’t think it can, and even if it could, I don’t think I would want that.

I tested the Beta plugin on 3 sabers, one with a quad blade, two with oled displays, and one with a bluetooth module. All three were v3.9 boards. All three worked the same under 3.6 and 4.6.

ProffieOS 7.14
Arduino 2.3.4
Windows 11

I don’t have a mac to test on, but I will dig up a v2.2 board over the weekend if you still need testing.

1 Like