STM32 cryptographic library - GCC compatibility
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-11 11:26 AM
Hello
Maybe I'm wrong, but thehttp://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259409
only provides binaries compatible with compilers from Keil or IAR but none for GCC. Since the sources aren't openly available, for reasons I can understand, is it possible that somebody from ST provides us an GCC compatible version? Thank you. #stm32-cryptograhic-library-gcc #understand-your-tools #understand-your-tools #know-your-tools- Labels:
-
Cryptography
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-11 04:29 PM
I was able to achieve linkage against the IAR's EWARM\M4_CryptoFW_RngHW_2_0_6.a for an STM32F4-Discovery build by adding some shims for the aeabi functions.
abi.c// IAR to GNU/GCC ABI Shim - sourcer32@gmail.com
#include <
stdlib.h
>
#include <
string.h
>
void __aeabi_memcpy(void *dest, const void *src, size_t n)
{
memcpy(dest, src, n);
}
void __aeabi_memcpy4(void *dest, const void *src, size_t n)
{
memcpy(dest, src, n);
}
void __aeabi_memclr(void *dest, size_t n)
{
memset(dest, 0, n);
}
void __aeabi_memclr4(void *dest, size_t n)
{
memset(dest, 0, n);
}
void __aeabi_memset(void *dest, char c, size_t n)
{
memset(dest, c, n);
}
Still need to evaluate the functionality.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-12 03:09 AM
Thank you
It compiles. I will have to check if everything works right now. But if ST wanted to provide us a GCC compatible version it would be even better :)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-13 03:59 AM
I'm having that error now:
C:\SVN\MCD_STM32_Cryptographic_V2_0_6\LibraryCreation\Cortex_M4_FW\Crypto_Sources_Files\crypto.c:(.text+0x11250): undefined reference to `RCC_AHBPeriphClockCmd' I don't know how to solve that. Can someone help me please?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-13 04:25 AM
I don't know how to solve that. Can someone help me please?
Must use M4_CryptoFW_RngHW_2_0_6.a not M4_CryptoFW_2_0_6.aUp vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-13 06:27 AM
Everything works now.
Thank you for your help!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-15 07:23 AM
How can I tell to makefile to include the library? I am using GCC without any IDE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-15 07:41 AM
How can I tell to makefile to include the library? I am using GCC without any IDE.
That would depend greatly on the structure/construction of YOUR makefile, wouldn't it? Libraries are just another list of files passed to the linker. .. # libraries (additional libraries for linking, e.g. ''-lm -lsome_name'' to link # math library libm.a and libsome_name.a) LIBS = M4_CryptoFW_RngHW_2_0_6.a .. #-----------------------------------------------------------------------------# # linking - objects -> elf #-----------------------------------------------------------------------------# $(ELF) : $(OBJS) @echo 'Linking target: $(ELF)' $(CXX) $(LD_FLAGS_F) $(OBJS) $(LIBS) -o $@ @echo ' '
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-21 07:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-21 09:04 AM
You'd have to do some analysis of the library itself and understand where the dependencies are coming from, and why the dead code elimination isn't being done by the linker. If the objects within the library are granular enough, perhaps you can use a library manager to extract only the objects you need, and link against those.
You could also try building with Keil or IAR and see if they generate more compact output. I don't have time/resources to do this analysis for you.Up vote any posts that you find helpful, it shows what's working..