hello,
I have an issue while compiling, and i guess it comes from the 'AVR/io.h' file where it should set the __AVR_ATMEGA644__ variable and thus redirect the links to the right code
#elif defined (__AVR_ATmega644__)
# include <avr/iom644.h>
how can i set in eclipse or in the .cproject the avrdevice ?
i tried the option -mmcu=atmega644 without any success !
cheers!
Comments
arm-none-eabi-gcc
-mcpu=cortex-m4 -mthumb O2 -g
-DF_CPU=20000000UL -D__PROG_TYPES_COMPAT__
-I/usr/local/CrossPack-AVR-20131216/avr/include -std=gnu11 -MMD -MP
-MF"Preset/presetManager.d" -MT"Preset/presetManager.o" -c -o
"Preset/presetManager.o" "../Preset/presetManager.c"
note that meanwhile, i found a beginning of explanation on the web -> saying that i shouldd add in my compilation build the following option: -mmcu=avr5 -D__AVR_ATmega644__
in eclipse (and I am on MAC), i setup in my eclipse config (toolchain) with the option flag: -mthumb -mmcu=avr5 -D__AVR_ATmega644__
my compilation is now like this :
arm-none-eabi-gcc
-mcpu=cortex-m4 -mthumb -mmcu=avr5 -D__AVR_ATmega644__ -O2 -g
-DF_CPU=20000000UL -D__PROG_TYPES_COMPAT__
-I/usr/local/CrossPack-AVR-20131216/avr/include -std=gnu11 -MMD -MP
-MF"Preset/presetManager.d" -MT"Preset/presetManager.o" -c -o
"Preset/presetManager.o" "../Preset/presetManager.c"
I got --> arm-none-eabi-gcc: error: unrecognized command line option '-mmcu=avr5'
bouuuhhh :-(
any advice ?
cheers :-)
:-)
the code compils until i get the error:
In file included from ../Preset/../Menu/menu.h:16:0,
from ../Preset/../Menu/CcNr2Text.h:12,
from ../Preset/presetManager.c:11:
../Preset/presetManager.c: In function 'preset_loadDrumset':
/usr/local/CrossPack-AVR/avr/include/avr/pgmspace.h:452:5: error: impossible constraint in 'asm'
__asm__ __volatile__ \
^
If it continues, i am going to use a Linux instead of a MAC !!!
arm-none-eabi-gcc -DHSE_VALUE=8000000 -DSTM32F4XX -DUSE_DEVICE_MODE -DUSE_USB_OTG_FS -DUSE_STDPERIPH_DRIVER -DUSE_STM32F4_DISCOVERY -DNDEBUG "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\Libraries\\CMSIS\\Include" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\Libraries\\Device\\STM32F4xx\\Include" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\Libraries\\STM32F4xx_StdPeriph_Driver\\inc" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\Libraries\\STM32_USB_Device_Library\\Core\\inc" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\Libraries\\STM32_USB_OTG_Driver\\inc" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\src" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\src\\AudioCodecManager" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\src\\DSPAudio" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\src\\Hardware" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\src\\Hardware\\SD_FAT" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\src\\Hardware\\USB" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\src\\MIDI" "-IC:\\project\\LXR\\mainboard\\firmware\\DrumSynth_FPU\\src\\Sequencer" -O3 -ffunction-sections -fdata-sections -ffast-math -freciprocal-math -fsingle-precision-constant -Wall -Wextra -Wa,-adhlns=$@.lst -c -fmessage-length=0 -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o "src\\MIDI\\MidiParser.o" "..\\src\\MIDI\\MidiParser.c"
And here is my command line for avr:
avr-gcc -DF_CPU=20000000UL -D__PROG_TYPES_COMPAT__ -Os -Wall -Wextra -Wconversion -c -funsigned-char -funsigned-bitfields -ffast-math -freciprocal-math -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -mmcu=atmega644 -std=gnu99 -MD -MP -o main.o "..\\main.c"
@pld if you could put somewhere your makefile, I would like to have a look at it :-)
thanks guys, I really appreciate your patience with me :-)
and if it continues , I will go for my linux :-) anyhow, here the command I did thanks to you:
arm-none-eabi-gcc -DHSE_VALUE=8000000 -DSTM32F4XX -DUSE_DEVICE_MODE -DUSE_USB_OTG_FS -DUSE_STDPERIPH_DRIVER -DUSE_STM32F4_DISCOVERY -DNDEBUG "-I/Users/music/Documents/workspace/DrumSynth_FPU/Libraries/CMSIS/Include" "-I/Users/music/Documents/workspace/DrumSynth_FPU/Libraries/Device/STM32F4xx/Include" "-I/Users/music/Documents/workspace/DrumSynth_FPU/Libraries/STM32F4xx_StdPeriph_Driver/inc" "-I/Users/music/Documents/workspace/DrumSynth_FPU/Libraries/STM32_USB_Device_Library/Core/inc" "-I/Users/music/Documents/workspace/DrumSynth_FPU/Libraries/STM32_USB_OTG_Driver/inc" "-I/Users/music/Documents/workspace/DrumSynth_FPU/src" "-I/Users/music/Documents/workspace/DrumSynth_FPU/src/AudioCodecManager" "-I/Users/music/Documents/workspace/DrumSynth_FPU/src/DSPAudio" "-I/Users/music/Documents/workspace/DrumSynth_FPU/src/Hardware" "-I/Users/music/Documents/workspace/DrumSynth_FPU/src/Hardware/SD_FAT" "-I/Users/music/Documents/workspace/DrumSynth_FPU/src/Hardware/USB" "-I/Users/music/Documents/workspace/DrumSynth_FPU/src/MIDI" "-I/Users/music/Documents/workspace/DrumSynth_FPU/src/Sequencer" -O3 -ffunction-sections -fdata-sections -ffast-math -freciprocal-math -fsingle-precision-constant -Wall -Wextra -Wa,-adhlns=$@.lst -c -fmessage-length=0 -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o "/Users/music/Documents/workspace/DrumSynth_FPU/src/MIDI/MidiParser.o" "/Users/music/Documents/workspace/DrumSynth_FPU/src/MIDI/MidiParser.c"
and it compiles :-) no error. I will continue the compilation and come back to you asap.
MacBook-Pro-de-ribas:workspace music$ avr-gcc -DF_CPU=20000000UL -D__PROG_TYPES_COMPAT__ -Os -Wall -Wextra -Wconversion -c -funsigned-char -funsigned-bitfields -ffast-math -freciprocal-math -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -mmcu=atmega644 -std=gnu99 -MD -MP -o main.o "/Users/music/Documents/workspace/DrumSynth_FPU/src/main.c"
I got an error about the lib STM32F4 not including in the path... I progress in a better way now than woth Eclipse!!!
/Users/music/Documents/workspace/DrumSynth_FPU/src/main.c:36:23: fatal error: stm32f4xx.h: No such file or directory
#include "stm32f4xx.h"
keep you inform on my progress :-)
i need to upload the new fresh firmware on the hardware now, i keep you inform.
so I could compile your code for the DRUM part ... :-)
now I will look at the AVR code and try to compile it.
:-)
i am now going tp upload the new firmware i built :-)
bye!
works fine ! i am now going to write a tuto :-)
and i allready changed successfully the LXR code :-)
GREAT THX !!!!!
not needed to say that I removed my eclipse installation right away !
I will do a tuto before continuing :-)
next, I want to create a git hub repo, etc... and change the code in order to
- add a random function and
- one knob changes several parameters when you are in PERF mode.
I hope to have enough patient and knowledge to implement this!
so I guess , it will work as well for you @pld :-)