migrating from v2 to v3

Discussions and support about ChibiOS/RT, the free embedded RTOS.
ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

migrating from v2 to v3

Postby ralph » Tue Nov 13, 2018 4:44 pm

I am working to update a working ChibiOS project to the current version. Updated the makefiles to use the new rules file, etc. and worked through most of the errors. However, I have a couple I am having trouble chasing down:
/home/ext/ChibiOS_18.2.1/os/common/startup/ARMCMx/compilers/GCC/rules.mk:238: target 'build/obj/crt0_v7m.S' doesn't match the target pattern
/home/ext/ChibiOS_18.2.1/os/common/startup/ARMCMx/compilers/GCC/rules.mk:238: target 'build/obj/vectors.S' doesn't match the target pattern
/home/ext/ChibiOS_18.2.1/os/common/startup/ARMCMx/compilers/GCC/rules.mk:238: target 'build/obj/chcoreasm_v7m.S' doesn't match the target pattern

Can anyone point me to where those files get selected and set, and any suggestions on fixing the errors?

Thanks.

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: migrating from v2 to v3

Postby Giovanni » Tue Nov 13, 2018 5:05 pm

Hi,

It does not find those files, check your CHIBIOS variable in makefile, it must point to the root of a ChibiOS source tree.

Take makefile and configuration files from the version you want to use, trying to adjust old files is usually a bad idea.

Giovanni

ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Postby ralph » Tue Nov 13, 2018 7:49 pm

I am using the .mk files from the new version, and update the paths in the ChibiOS makefile. I am running a Makefile for my project, I have updated all the paths to the new version.

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: migrating from v2 to v3

Postby Giovanni » Tue Nov 13, 2018 8:34 pm

Hi,

Those files are included by this line:

Code: Select all

# Startup files.
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk


Look inside that .mk file.

Giovanni

ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Postby ralph » Mon Nov 19, 2018 2:30 pm

I started over with the closest example, verified that built, then added back in my project specific paths, etc. Unfortunately I am still having the same issue. Output from running make with the debug option suggests that these files do build after this error, but not correctly, it keeps retrying but not succeeding.

I did verify that startup_stm32f4xx.mk is present and accessed from the correct directory.

I would appreciate any guidance on tracking down this error.

The last several lines from the debug:

Code: Select all

Finished prerequisites of target file 'build/obj/crt0_v7m.S'.
    Must remake target 'build/obj/crt0_v7m.S'.
Putting child 0x561b4b8ef780 (build/obj/crt0_v7m.S) PID 17053 on the chain.
Live child 0x561b4b8ef780 (build/obj/crt0_v7m.S) PID 17053
Compiling
Reaping winning child 0x561b4b8ef780 PID 17053
Live child 0x561b4b8ef780 (build/obj/crt0_v7m.S) PID 17054
arm-none-eabi-gcc: warning: '-x assembler-with-cpp' after last input file has no effect
arm-none-eabi-gcc: fatal error: no input files
compilation terminated.
Reaping losing child 0x561b4b8ef780 PID 17054
MakefileExplained.txt:1087: recipe for target 'build/obj/crt0_v7m.S' failed
make: *** [build/obj/crt0_v7m.S] Error 1
Removing child 0x561b4b8ef780 PID 17054 from chain.


make results without debug:

Code: Select all

MakefileExplained.txt:1082: target 'build/obj/crt0_v7m.S' doesn't match the target pattern
MakefileExplained.txt:1082: target 'build/obj/vectors.S' doesn't match the target pattern
MakefileExplained.txt:1082: target 'build/obj/chcoreasm_v7m.S' doesn't match the target pattern
OBJDIR is build/obj
Compiling crt0_v7m.S
Compiling vectors.S
Compiling chcoreasm_v7m.S
Compiling
arm-none-eabi-gcc: warning: '-x assembler-with-cpp' after last input file has no effect
arm-none-eabi-gcc: fatal error: no input files
compilation terminated.
MakefileExplained.txt:1087: recipe for target 'build/obj/crt0_v7m.S' failed
make: *** [build/obj/crt0_v7m.S] Error 1

ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Postby ralph » Mon Nov 19, 2018 7:53 pm

For those who may find this thread in the future or are having similar issues:
The crt0_v7m.S,vectors.S and chcoreasm_v7m.S files were not building because the processor type variable was not updated to comply with Chibios5.0.0 requirements. I needed to add

Code: Select all

#define STM32F427xx
to my board.h file.

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: migrating from v2 to v3

Postby Giovanni » Mon Nov 19, 2018 8:01 pm

Board files are generated, you should not need to edit those manually.

Anyway, it is correct, board.h needs to define the device identifier.

Giovanni

ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Postby ralph » Mon Nov 19, 2018 10:06 pm

Where are the board files generated? Maybe I fixed a symptom rather than the root cause.

I should also note I am using a custom designed board, it is not one of the standard demo boards.

The current issue is that I am getting errors from hal_lld.h such as:

Code: Select all

#error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"


It does not seem to be picking up the clock definitions in mcuconf.h

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: migrating from v2 to v3

Postby Giovanni » Mon Nov 19, 2018 10:20 pm

Hi,

Look into the board directories, you should see in there a cfg/board.chcfg file, it is an XML describing the board. Board.c/.h/.mk files are generated from that xml using a functionality in ChibiStudio: select the .chcfg file and click on the button that appears in the toolbar.

It can also be done from command line but it is more complex and requires some setup.

Giovanni

ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v5.0.0

Postby ralph » Mon Nov 26, 2018 9:05 pm

Thanks, that's helpful.

Making good progress, I'm getting link errors now :-)

Any simple/easy/known fix to C++11 system call issues? Read the thread on the wrapper, but it sounds like that was rolled into the current version.

Code: Select all

undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
undefined reference to `operator delete(void*)'
undefined reference to `operator new(unsigned int)'
undefined reference to `__cxa_end_cleanup'
...


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 36 guests