Forum Discussion
Altera_Forum
Honored Contributor
7 years ago --- Quote Start --- Can confirm the behavior. Compiles correctly with 16.0 but fails with 18.0. That file does not come with the design example, it is copied into the directory by Eclipse from embedded/ip/hps/altera_hps/hwlib/src/hwmgr/soc_cv_av/alt_bridge_manager.c. The crux of the issue is that, between 16.0 and 18.0, someone changed that file and replaced three calls to memcpy with calls to a C11 function memcpy_s (which does the same thing as memcpy, except it also checks for destination buffer length). However, the cross-compiler that comes with 18.0 (Sourcery CodeBench 6.2.0) does not have an implementation of memcpy_s. To build it with 18.0, you either need to replace memcpy_s with memcpy directly in the original inside the EDS tree (don't forget to remove the extra argument), or edit the makefile. To HWLIBS_SRC, add
memcpy_s.c mem_primitives_lib.c safe_mem_constraint.c ignore_handler_s.c
To CFLAGS, add -I$(HWLIBS_ROOT)/src/safeclib -I$(HWLIBS_ROOT)/include/safeclib
To ALL_HWLIBS_SRC, add $(wildcard $(HWLIBS_ROOT)/src/safeclib/*.c) --- Quote End --- Thanks eugenek! Seems like you're helping me all over the forum. I was able to get the project to compile, but now I'm not sure how to get it to run on the board. The instructions that came with the example only say "Run the project from eclipse" but I tried hitting running either of the .axf files generated (the uboot or the example_design) and both gave eclipse errors about failing to start process. Am I supposed to copy these to the board then restart the board? I'm sorry I've never run a baremetal app before.