Proffieboard reprogramming?

So i just recently got a proffie saber but it seems it may be programmed incorrectly. It’s a 1 button set up but for some reason it is following the instruction set for a 2 button set up (e.g. I press once when on which should do blaster deflect but it turns off instead) meaning because im missing a second button most features don’t work. I have talked to customer support but they are yet to get back and i assume they’ll just ask me to send it away for repair and that will take ages. I wanted to know if it’s a good idea to attempt reprogramming the board myself to a 1 button set up to see if that fixes it or if that would most likley mess the whole thing up more? I have been told by one person it may be wired incorrectly but I’m not sure if its even possible to screw up production that bad. But please, lend your advise.

Re-programming the board is not that hard. However, in order to do it correctly, you need to know how the saber was wired, or you need to start with a config file that works. Did your saber come with a config file? (or a ProffieOS directory/zip?) We usually encourage installers to put that sort of stuff on the SD card.

If it’s there, it makes the process a lot easier.

Re-programming the saber is generally pretty safe, it’s unlikely that you’ll mess anything up that can’t be fixed by just programming it again. However, please do make sure to backup everything on the SD card, and to be safe, it might be best to backup the programming that is on the board itself:

Note that this backup won’t be a config file, or anything human-readable, just a file full of machine code. But with a backup of the board, and a backup of the SD card, you can always go back.

I followed all of the steps so far to programme the board but when i try to upload proffieOS to the board it says “Failed uploading: uploading error: exit status 255” and stops recognising the board until I unplug and plug back in. Is there any way to fix this?

mysaber_config.h (1.9 KB)

Use the copy error messages button, then post here inside backticks.
Type ``` then hit return,
paste error message,
hit return,
type 3 more backticks

like this
c:/users/user1/appdata/local/arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\Finnley\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6\variants\STM32L433CC-ProffieboardV2/linker_scripts/STM32L433CC_FLASH.ld:224: warning: memory region `SRAM2' not declared
Sketch uses 203760 bytes (77%) of program storage space. Maximum is 262144 bytes.
Failed uploading: uploading error: exit status 255

Did you use Fast optimization? Generally only Smallest work.

yea i used smallest

Do you have the file ProffieOS/ProffieOS.ino open in Arduino?
Close any other windows open in Arduino.
I think that error comes up when trying to compile an empty sketch, or a default template one that might come up for you when opening arduino by clicking the app.
Typically, I just double click the .ino, that way I’m sure I have the right file open.
In fact, easiest thing for you is really just quit Arduino and double click ProffieOS.ino.
Make sure the CONFIG_FILE is set correctly and try Verify.

just tried it, same error unfortunately. If theres any chance someone could hop on a discord call or smth to see whats going on that would be greatly appriciated

just changed programmer to ST-Link V2 and clicked upload using programmer and it now says this

c:/users/finnley/appdata/local/arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\Finnley\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6\variants\STM32L433CC-ProffieboardV2/linker_scripts/STM32L433CC_FLASH.ld:224: warning: memory region `SRAM2' not declared
Sketch uses 209320 bytes (79%) of program storage space. Maximum is 262144 bytes.
Open On-Chip Debugger 0.10.0-dev-00272-gf17dc4a (2016-10-10-09:38)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
adapter speed: 500 kHz
adapter_nsrst_delay: 100
none separate
none separate
Error: open failed
in procedure 'program' 
in procedure 'init' called at file "embedded:startup.tcl", line 473
in procedure 'ocd_bouncer'
** OpenOCD init failed **
shutdown command invoked

Failed programming: uploading error: exit status 1

Yeah. you don’t want to do that. Did you try with just the default config to test?

Yea, at this point I’m pretty sure I’ve tried every variation of options to try and upload but no matter what the same thing happens with the error 255 if i do it the way I’m supposed to. I’m really confused because I’ve flashed the board, reinstalled firmware, flashed again and tried to upload at every step but nothing works

To me this sort of looks like some part of the arduino-proffieboard plugin is missing. I would suggest trying to re-install it and see if that helps.

If that doesn’t help, maybe we can at least get better error messages:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Uncheck the checkbox next to Show verbose output during: compilation
  3. Check the checkbox next to Show verbose output during: ☐ upload.

I just did a fresh install and now it doesn’t want to compile either

FQBN: proffieboard:stm32l4:ProffieboardV2-L433CC
Using board 'ProffieboardV2-L433CC' from platform in folder: C:\Users\F\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6
Using core 'stm32l4' from platform in folder: C:\Users\F\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6

Detecting libraries used...
"C:\\Users\\F\\AppData\\Local\\Arduino15\\packages\\proffieboard\\tools\\arm-none-eabi-gcc\\9-2020-q2-update/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib -fno-rtti -fno-exceptions -flto -fdevirtualize-at-ltrans -w -x c++ -E -CC -D_SYSTEM_CORE_CLOCK_=80000000L -DARDUINO=10607 -DARDUINO_STM32L4_BUTTERLY -DARDUINO_ARCH_STM32L4 -DSTM32L433xx -DPROFFIEBOARD_VERSION=2 -D__FPU_PRESENT=1 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mabi=aapcs -mslow-flash-data -fsingle-precision-constant -felide-constructors -ffast-math -DUSB_VID=0x1209 -DUSB_PID=0x6668 -DUSB_DID=0xffff "-DUSB_MANUFACTURER=\"hubbe.net\"" "-DUSB_PRODUCT=\"Proffieboard\"" -DUSB_TYPE=USB_TYPE_CDC -DDOSFS_SDCARD=1 -DDOSFS_SFLASH=0 "-IC:\\Users\\F\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\3.6/system/CMSIS/Include" "-IC:\\Users\\F\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\3.6/system/CMSIS/Device/ST/STM32L4xx/Include" "-IC:\\Users\\F\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\3.6/system/STM32L4xx/Include" "-IC:\\Users\\F\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\3.6\\cores\\stm32l4" "-IC:\\Users\\F\\AppData\\Local\\Arduino15\\packages\\proffieboard\\hardware\\stm32l4\\3.6\\variants\\STM32L433CC-ProffieboardV2" "C:\\Users\\F\\AppData\\Local\\Temp\\arduino\\sketches\\991BB28BB787F7F79899554794787FA7\\sketch\\ProffieOS.ino.cpp" -o nul
In file included from c:\users\f\appdata\local\arduino15\packages\proffieboard\tools\arm-none-eabi-gcc\9-2020-q2-update\arm-none-eabi\include\c++\9.3.1\cstdlib:75,
                 from c:\users\f\appdata\local\arduino15\packages\proffieboard\tools\arm-none-eabi-gcc\9-2020-q2-update\arm-none-eabi\include\c++\9.3.1\stdlib.h:36,
                 from C:\Users\F\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6\cores\stm32l4/Arduino.h:25,
                 from Z:\Misc\ProffieOS\ProffieOS.ino:159:
c:\users\f\appdata\local\arduino15\packages\proffieboard\tools\arm-none-eabi-gcc\9-2020-q2-update\arm-none-eabi\include\stdlib.h:22:10: fatal error: alloca.h: No such file or directory
   22 | #include <alloca.h>
      |          ^~~~~~~~~~
compilation terminated.
Alternatives for alloca.h: []
ResolveLibrary(alloca.h)
  -> candidates: []

exit status 1

Compilation error: exit status 1

Did you abort the installation in the middle or something?
It looks like it’s missing files.

I did another fresh install and now it compiles correctly. I now have another line to the error code

c:/users/f/appdata/local/arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\F\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6\variants\STM32L433CC-ProffieboardV2/linker_scripts/STM32L433CC_FLASH.ld:224: warning: memory region `SRAM2' not declared
Sketch uses 200808 bytes (76%) of program storage space. Maximum is 262144 bytes.
Performing 1200-bps touch reset on serial port COM3
"C:\Users\F\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6/tools/windows/stm32l4-upload.bat" "0x1209" "0x6668" "C:\Users\F\AppData\Local\Temp\arduino\sketches\991BB28BB787F7F79899554794787FA7/ProffieOS.ino.dfu"
Failed uploading: uploading error: exit status 255

This is the command that fails somehow.
Does that bat file exist?
If you run this command in a terminal, do you get the same error?

Also, you can try opening up the bat file in a text editor, and then remove the first line (@echo off) then if you try it again, it will hopefully show us which command within the bat file it is that is failing.

I removed the @echo off and here it is

c:/users/f/appdata/local/arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\F\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6\variants\STM32L433CC-ProffieboardV2/linker_scripts/STM32L433CC_FLASH.ld:224: warning: memory region `SRAM2' not declared
Sketch uses 203752 bytes (77%) of program storage space. Maximum is 262144 bytes.
Performing 1200-bps touch reset on serial port COM3
"C:\Users\F\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6/tools/windows/stm32l4-upload.bat" "0x1209" "0x6668" 
"C:\Users\F\AppData\Local\Temp\arduino\sketches\991BB28BB787F7F79899554794787FA7/ProffieOS.ino.dfu"

Z:\Misc\ProffieOS>set count=1 

Z:\Misc\ProffieOS>"C:\Users\F\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6\tools\windows\\dfu-util.exe" -l -d 0483:df11   | findstr "Found"  1>NUL 2>&1 
Failed uploading: uploading error: exit status 255

this is what the bat file looks like if that helps

@echo off
set count=1
:wait
    "%~dp0\dfu-util.exe" -l -d 0483:df11 | findstr "Found" >NUL 2>&1
    if %errorlevel% == 0 ( 
	"%~dp0\dfu-util.exe" -d %1:%2,0x0483:0xdf11 -a 0 -s 0x08000000:leave -D %3
    ) else (
        if %count% gtr 10 goto break 
        echo %count%
        set /A count+=1
        ping -n 1 127.0.0.1 >NUL
        goto :wait
    )
)

:break: