Issues With CMSIS In STM32IDE - stm32

I'm completely new to microcontroller programming and I'm facing my first problem.
I'm following tutorials and web documentation in order to starting with STM32 libraries, I tried to add CMSIS and HAL drivers into my stm32IDE but every time I try to build a huge quantity of errors occure. Someone can explain to me what is wrong ?
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:399: Error: bad instruction `section .text:CODE:REORDER:NOROOT(1)'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:400: Error: bad instruction `i2c2_ev_irqhandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:403: Error: bad instruction `pubweak I2C2_ER_IRQHandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:404: Error: bad instruction `section .text:CODE:REORDER:NOROOT(1)'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:405: Error: bad instruction `i2c2_er_irqhandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:408: Error: bad instruction `pubweak SPI1_IRQHandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:409:
.
.
.
.
make: *** [Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/subdir.mk:91: Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.o] Error 1
"make -j12 all" terminated with exit code 2. Build might be incomplete.
00:32:15 Build Failed. 5895 errors, 0 warnings. (took 2s.475ms)

You are trying to compile the IAR startup files with the GCC compiler. The startup assembler file that you want is under the directory gcc. The two assemblers have different syntax.

Related

Converting Modelica models from Dymola to JModelica - Addressing Errors in Log File

I am currently trying to compile the netCDF-DataReader in JModelica but it appears the package has been developed in Dymola. The process fails at the compilation stage:
netCD = compile_fmu('NcDataReader2.Examples.Simple',r'H:\Modelica\Modelica Libraries\NcDataReader2',compiler_log_level= 'w,i:log.txt')
CcodeCompilationError: Compilation of generated C code failed.
The log file created contains 326 lines. Midway it says
====== Model compiled successfully =======
But there are many errors after. Some of the errors include:
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" '
unrecognized collect2.exe: error: ld returned 1 exit status
mingw32-make1: *** [ceval_] Error 1 Cannot export
??_C#_01LFCBOECM#?4?$AA#: symbol not found Cannot export
??_C#_01NOFIACDB#w?$AA#: symbol not found
C:\JModelica.org-2.1\install\Makefiles\MakeFile:190: recipe for target
'fmume10' failed
I don't have much experience with compilers and debugging C-code and would prefer to spend my time focused on creating models; therefore this leads to a number of questions:
Are there patterns in this errror log that could be addressed in such a way to make Dymola libraries useable in other Modelica based programs, such as JModelica?
Are then any other compilers that may be more suited to cross-compatible models?
Am I wasting my time trying to make Dymola models run in JModelica? Would it be more sensible to recreate the model separately in JModelica? The lack of a front-end interface makes this tricky.
The problem is that the external libraries available in netCDF-DataReader needs to be compiled using the GCC compiler available in the JModelica distribution. Try to recompile the libraries using GCC and put the libraries in NcDataReader2\Resources\Library\win32 (or even better put them in NcDataReader2\Resources\Library\win32\gcc472)

Unknown Eclipse Errors using gfortran, Cygwin

Using Windows 7 64 bit. I've followed these instructions for installing Eclipse for Parallel Application Developers and Cygwin, the latter because I want gfortran to compile Fortran code. At 18:20 in the linked tutorial he compiles in Eclipse with no errors, but I get the following 2 errors (Project is called "example"):
Description Resource Path Location Type
make: *** [example] Error 1 example C/C++ Problem
recipe for target 'example' failed makefile /example/Debug line 29 C/C++ Problem
My code (main.f90, under project "example") is simply
program main
print*, "hello world"
end program main
I've also tried compiling through the terminal, but get the following:
>>gfortran main.f90
gfortran: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated
Any help is appreciated!
The tutorial, you linked, is 2 years old...
As far as I see from the content of the packages available from http://www.cygwin.com/packages/, you have to install gcc-fortran instead of gcc4-fortran, because the latter one is labeled as obsolete.
The library cyglto_plugin.dll, which is used for Link-Time-Optimization, can be found in the package gcc-core and should be installed as a dependency. You could try to disable this library by using -fno-use-linker-plugin, but this will disable some optimization.

Raspberry PI cross compilation linking error - unknown symbol _dl_hwcap

I have successfully set up a cross-complation environment for my RPI under 64 Bit ubuntu. I can compile and run a personal project using gstreamer just fine.
Due to performance-issues with gstreamer, I want to work on a fork of omxplayer. I adapted it to my environment, and compilation of ffmpeg and omxplayer themselves work just fine.
However, linking an actual executable (ffmpeg, or omxplayer.bin) yields a linking error I have been unable to resolve.
You find the full output of the last failing linking-step with verbose flags here:
https://gist.github.com/deets/3bba7c94017405d28f81
The error message is
ffmpeg_compiled/usr/local/lib/libavcodec.so: undefined reference to `_dl_hwcap'
collect2: error: ld returned 1 exit status
The missing symbol to me suggests something with dynamic loading. Maybe the libc or libdl are botched? But how come these are working just fine if compiling another project?
Found the culprit. When setting up the crosscompilation-environment, make sure your copy of the RPI's libraries are correct. I had unresolved symbolic library links that needed fixing in my rsync'ed copy of the RPI's file-system.

Opencv file format not recognized error

Based on this tutorial I made the install of my opencv. I'm running everything on 64 bits and I'm receiving one compilation error through console output:
10:55:25 **** Incremental Build of configuration Debug for project DisplayImage ****
Info: Internal Builder is used for build
g++ "-LC:\\opencv\\build\\x64\\mingw\\bin" -o DisplayImage.exe "src\\DisplayImage.o" -lopencv_ml246 -lopencv_imgproc246 -lopencv_core246 -lopencv_highgui246
C:\opencv\build\x64\mingw\bin/libopencv_ml246.dll: file not recognized: File format not recognized
collect2: ld returned 1 exit status
10:55:26 Build Finished (took 232ms)
"The file is not recognized."
Making one research I found some links like this which complains about the same problem but nobody gave one feedback solution. So, could anybody help me understand why my build is stuck on this part? Thanks in advance

error with "pmem.c" compiling linux source code for android

I am compiling linux source code for android emulator. When i execute make command(for building and cross-compiling the linux source) i get the following error "pmem.c" file.
root#ubuntu:~/common# make
CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86
CALL scripts/checksyscalls.sh
CHK include/linux/compile.h
CC drivers/misc/pmem.o
drivers/misc/pmem.c:441: error: conflicting types for ‘phys_mem_access_prot’
/home/preetam/common/arch/x86/include/asm/pgtable.h:383: note: previous declaration of ‘phys_mem_access_prot’ was here
drivers/misc/pmem.c: In function ‘flush_pmem_file’:
drivers/misc/pmem.c:805: error: implicit declaration of function ‘dmac_flush_range’
drivers/misc/pmem.c: In function ‘pmem_setup’:
drivers/misc/pmem.c:1265: error: implicit declaration of function ‘ioremap_cached’
drivers/misc/pmem.c:1266: warning: assignment makes pointer from integer without a cast
make[2]: *** [drivers/misc/pmem.o] Error 1
make[1]: *** [drivers/misc] Error 2
make: *** [drivers] Error 2
root#ubuntu:~/common#
how to resolve this error. It seems that there may some problems in the "pmem.c" file and i'll have to choose different git repository. but that would be a very complex thing, as now i have already done most of the things till here. I might have to see correct version of this file. please someone tell what should i do?
how to solve this errors.
please help..thankyou!
There are several errors in the message you pasted, both conflicting types and implicit declarations. Three things that you might want to verify:
did you choose the correct processor architecture (ARCH) and cross compiler definition
does the chosen architecture mix in files from another arch (this is difficult to check, but you can start by checking the location of the files that are mentioned in the error message)
check these files themselves, to see it this is a bug (very unlikely, but you never know) and that you actually have to change some code