0

I currently have a very big problem with the link between my stm32 project and a static library that can display different barcodes (QRCode, Datamatrix...) Indeed, I need this library to display different barcodes on an Epaper screen.

Unfortunately I can't find a simple source code to implement in my project. I have to go through a static library...

I managed to compile this one for the good architecture of my board but my project displays a storage error. I don't know how to do it anymore! If someone has a solution, I'll be delighted!

The best for me would be to simply use the sources of this library but these sources need to be precompiled to work together...

On the net I had managed to find just a .c and a .h for QRCodes (which works perfectly in my project), but for other types of code I can't find anything (Datamatrix, Code128, Aztec Code...).

Library link: https://github.com/woo-j/zint

Console log :

Building target: Peson_2.elf
Invoking: MCU GCC Linker
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -static -L"C:\libs\zint\build\backend" -specs=nosys.specs -specs=nano.specs -T"../STM32F401RCTx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "Peson_2.elf" @"objects.list"  -lzint-static -lm
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: Peson_2.elf section `.rodata' will not fit in region `FLASH'
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 153928 bytes
collect2.exe: error: ld returned 1 exit status
makefile:38: recipe for target 'Peson_2.elf' failed
make: *** [Peson_2.elf] Error 1

14:02:01 Build Finished (took 18s.724ms)
the busybee
  • 10,755
  • 3
  • 13
  • 30
  • ".rodata' will not fit in region FLASH" and "FLASH overflowed" kind of sums it up, yeah? Maybe because your STM32F4 isn't a PC. Specifically, the constants used by your program take too much flash. You'll need a lib written for embedded systems, not some random Github barf written for PC. – Lundin Jan 26 '21 at 13:32
  • "Zint is primarily developed for Linux. While we have some experience of using Zint on Windows we may be unable to resolve problems if they are specific to other operating systems." They don't even guarantee it will work in Windows. – Lundin Jan 26 '21 at 13:34
  • Thank you for your prompt responses, My only chance, if I understand correctly, is to find source codes for the creation of my barcodes (even if I have browsed all the c source codes of this planet). I had started to build a library for Datamatrixs, but this one takes too much time to build (very complicated reed-solomon error correction). So, with the embedded system, there are huge limits... – Jérémy2000 Jan 26 '21 at 13:49
  • On the other hand, zint as a static library in c, works great on a windows environment (such as the CodeBlocks EDI). – Jérémy2000 Jan 26 '21 at 13:52
  • What you can do is to peek at their code then write your own port of it. That lib supports a tonne of different encodings and you likely only need to support a few. Still, there's the image processing part which may or may not be CPU intensive depending on resolution etc. I haven't done any such projects myself but I think more high end CPUs are used. DSP, Cortex A, PowerPC, Renesas RX32 etc. – Lundin Jan 26 '21 at 13:54
  • Yes it's true that I don't have any other solution, at the moment I've already managed to write code that allows me to draw Code128B and Datamatrix of only 3-5 encoded characters. – Jérémy2000 Jan 26 '21 at 14:07
  • 1
    How is the static library built? Is each source file compiled separately? Object modules of searched libraries are only included if they resolve an open reference. If you compile all functions from one source, the whole blob will be linked. – the busybee Jan 26 '21 at 15:18
  • The library compiles all source files into a ".a" object. And you can't compile them with a single source file (for example you insert the #include "zint.h" in main). It's a static library, if you don't precompile it, it's unusable. I can only use the ".a" with system workbench (Eclipse) as IDE. I even tried on code blocks, taking only the source code but nothing works. – Jérémy2000 Jan 26 '21 at 15:42

0 Answers0