(Im new to c++)
I’m trying to make a midi keyboard with my daisy seed, right now i have a 4 by 3 matrix, 3 rows of outputs, and 4 rows of input. I haven’t managed to do anything yet, because when i try to upload the code to daisy :
#include "daisy_seed.h"
using namespace daisy;
using namespace daisy::seed;
DaisySeed hw;
int main(void) {
hw.Init();
//rows
GPIO rowA;
GPIO rowB;
GPIO rowC;
//columns
GPIO col1;
GPIO col2;
GPIO col3;
GPIO col4;
hw.StartLog(true);
hw.PrintLine("Hello World!");
rowA.Init(D1, GPIO::Mode::OUTPUT);
rowB.Init(D2, GPIO::Mode::OUTPUT);
rowC.Init(D3, GPIO::Mode::OUTPUT);
col1.Init(D4, GPIO::Mode::INPUT, GPIO::Pull::PULLDOWN);
col2.Init(D5, GPIO::Mode::INPUT, GPIO::Pull::PULLDOWN);
col3.Init(D6, GPIO::Mode::INPUT, GPIO::Pull::PULLDOWN);
col4.Init(D7, GPIO::Mode::INPUT, GPIO::Pull::PULLDOWN);
GPIO rows[3] = {rowA, rowB, rowC};
GPIO colms[4] = {col1, col2, col3, col4};
while(1) {
for (int i = 0; i <= 3; i++) {
rows[i].Write(true);
for (int j = 0; j <= 4; j++){
bool Ypress = colms[j].Read();
if (Ypress == true){
hw.PrintLine("button pressed: row%d", i," column%d", j);
}
}
System::Delay(10);
rows[i].Write(false);
if(i == 3) {
i = 0;
}
}
}
}
I get the following error in bash:
* Executing task: make clean; make; make program-dfu
rm -fR build
mkdir build
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000 -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER -include stm32h7xx.h -I../../libDaisy/ -I../../libDaisy//src/ -I../../libDaisy//src/sys -I../../libDaisy//src/usbd -I../../libDaisy//src/usbh -I../../libDaisy//Drivers/CMSIS/Include/ -I../../libDaisy//Drivers/CMSIS/DSP/Include -I../../libDaisy//Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libDaisy//Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libDaisy//Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libDaisy//Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../../libDaisy//Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc -I../../libDaisy//core/ -I../../DaisySP//Source -I../../libDaisy//Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -Wno-stringop-overflow -g -ggdb -MMD -MP -MF"build/startup_stm32h750xx.d" -std=gnu11 -Wa,-a,-ad,-alms=build/startup_stm32h750xx.lst ../../libDaisy//core/startup_stm32h750xx.c -o build/startup_stm32h750xx.o
arm-none-eabi-g++ -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000 -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER -include stm32h7xx.h -I../../libDaisy/ -I../../libDaisy//src/ -I../../libDaisy//src/sys -I../../libDaisy//src/usbd -I../../libDaisy//src/usbh -I../../libDaisy//Drivers/CMSIS/Include/ -I../../libDaisy//Drivers/CMSIS/DSP/Include -I../../libDaisy//Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libDaisy//Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libDaisy//Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libDaisy//Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../../libDaisy//Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc -I../../libDaisy//core/ -I../../DaisySP//Source -I../../libDaisy//Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -Wno-stringop-overflow -g -ggdb -MMD -MP -MF"build/MidiController.d" -fno-exceptions -fasm -finline -finline-functions-called-once -fshort-enums -fno-move-loop-invariants -fno-unwind-tables -fno-rtti -Wno-register -std=gnu++14 -Wa,-a,-ad,-alms=build/MidiController.lst MidiController.cpp -o build/MidiController.o
arm-none-eabi-g++ build/startup_stm32h750xx.o build/MidiController.o -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard --specs=nano.specs --specs=nosys.specs -T../../libDaisy//core/STM32H750IB_flash.lds -L../../libDaisy//build -L ../../DaisySP//build -ldaisy -lc -lm -lnosys -ldaisysp -Wl,-Map=build/MidiController.map,--cref -Wl,--gc-sections -Wl,--print-memory-usage -o build/MidiController.elf
Memory region Used Size Region Size %age Used
FLASH: 72004 B 128 KB 54.93%
DTCMRAM: 0 GB 128 KB 0.00%
SRAM: 23856 B 512 KB 4.55%
RAM_D2: 16 KB 288 KB 5.56%
RAM_D3: 0 GB 64 KB 0.00%
BACKUP_SRAM: 12 B 4 KB 0.29%
ITCMRAM: 0 GB 64 KB 0.00%
SDRAM: 0 GB 64 MB 0.00%
QSPIFLASH: 0 GB 8 MB 0.00%
arm-none-eabi-objcopy -O ihex build/MidiController.elf build/MidiController.hex
arm-none-eabi-objcopy -O binary -S build/MidiController.elf build/MidiController.bin
dfu-util -a 0 -s 0x08000000:leave -D build/MidiController.bin -d ,0483:df11
dfu-util 0.10
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2020 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Warning: Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "Internal Flash "
Downloading element to address = 0x08000000, size = 72004
Erase [=========================] 100% 72004 bytes
Erase done.
Download [=========================] 100% 72004 bytes
Download done.
File downloaded successfully
Error during download get_status
make: *** [../../libDaisy//core/Makefile:344: program-dfu] Error 74
* The terminal process "C:\Program Files\Git\bin\bash.exe '--login', '-i', '-c', 'make clean; make; make program-dfu'" terminated with exit code: 2.
* Terminal will be reused by tasks, press any key to close it.
I honestly dk what might be wrong here, since im new to cpp.