Errol is the man. A challenge is always fun
Heheh, my ST32F4 discovery kit arrives on Monday(cross fingers) or Tuesday. That is why I finally started playing with the PK.
Some people might have started playing with the PK just to be eligible for Hydra, but not me⦠;D
What the hell!!??
GCC defines int32_t as:
typedef signed long int32_t;
tinyhal_types.h defines UINT32 as:
typedef unsigned int UINT32;
They are not the same.
Ok, so Iām assuming that Iām beyond helpā¦
Anyway. Now ld.exe canāt find the libs that was compiled. Get this output:
[quote]d:\gcc\bin\arm-none-eabi-ld.exe: cannot find LargeBuffer_hal_stubs.lib: No suchfile or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find virtualkey_hal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find Crypto_stub.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find GlobalLock_hal_Cortex.lib: No suchfile or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find TinyHal_Cortex.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find cpu_prestackinit_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_bootstrap.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find batterycharger_hal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find batterymeasurement_hal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_GPIO.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_Power.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_time.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find cpu_watchdog_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find system_initialization_hal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find Watchdog_pal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find asyncproccall_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find blockstorage_pal.lib: No such fileor directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find Buttons_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find config_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find heap_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find piezo_pal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find SimpleHeap_stubs.lib: No such fileor directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find SimpleHeap_config_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find tinycrt_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find fs_pal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find Ink_pal_stubs.lib: No such file ordirectory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find Gesture_pal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find palevent_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find Time_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find FS_Config_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find TimeService_pal_stubs.lib: No suchfile or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find backlight_hal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find lcd_hal_stubs.lib: No such file ordirectory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find cpu_cache_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find cpu_LCD_stubs.lib: No such file ordirectory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_Flash.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_blconfig_STM32Stamp.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find BlockStorage_AddDevices_STM32Stamp.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find IO_Init_STM32Stamp.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_SPI.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_I2C.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_USART.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_USB.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_IntC.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_PWM.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find STM32_Analog.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find COM_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find DebuggerPort_SSL_config_stubs.lib:No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find events_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find sockets_pal_stubs.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find usart_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find usb_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find i2c_pal.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find usb_pal_config_stub.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find MFUpdate_PAL_stub.lib: No such file or directory
d:\gcc\bin\arm-none-eabi-ld.exe: cannot find ssl_pal_stubs.lib: No such file ordirectory
D:\MF\client_v4_2_comm\Solutions\STM32Stamp\TinyCLR>
[/quote]
Are you sure you have the correct parameters and path for gcc ? Maybe including some directories on PATH would help. Iām receiving my discovery kit today and will be playing with it when I have time.
Path where libs should be found is included on the command line.
Command line follows:
Yeah, fun, isnāt itā¦
Ok this is very interesting and you seem serious about this so let me help
Have you tried compiling the imxs project like I suggested in my porting book? No errors? all is good?
I did, and it worked, with the old gcc tool-chain.
But the old tool chain doesnāt have cortex-m4. So I upgraded to the latest tool chain. Had to fix up a bit of crap in core files, but got it to compile.
Tried to compile imxs with new tool chain. Also bombs on link phase.
Now reverted to old tool chain. Must fix mcpu core again etc. Will report back nowā¦
Edit: Just to clarify. iMXS now compiles with 26 odd warnings⦠STM32 still stuck at link stageā¦
Cool. Compiled for cortex-m3.
Down to one error:
Edit:
Nope. This linker just dies on the first file that it canāt find, unlike the newer one that looks for all filesā¦
I have even edited the gcc tool settings file to put the path in front of every lib file, but then the command wonāt execute in dos as the command line is 9000 chars longā¦
Do not use M4, keep on using M3. They are (almost) the same as far as NETMF code is concerned anyways.
⦠but I see you have already switched to M3 and it compiled.
The more you change the harder it gets. Do not try to patch things, instead, find the source of the problem and fix.
rolled back all core changes, including tool script changes.
I now get
I have traced this to the Cortex-M3 is thumb only. The command line for the gcc is missing an -mthumb flag⦠Where should I add that?
It can be in one of the script files or in the project ā*.settingsā file. I think it can be added wither way.
We know this compiles on MDK so there has to be an option you can copy.
Also, the solution āC:\MicroFrameworkPK_v4_2\Solutions\iMXS_thumbā is built in thumb mode so you can see how it is done.
In the STM32.settings there is this:
INSTRUCTION_SET>thumb2</INSTRUCTION_SET>
That works for MDK, but for GCC it must be without the ā2ā ie:
INSTRUCTION_SET>thumb</INSTRUCTION_SET>
It runs further, but still crashes on āNot Armā:
[quote]D:\MF\client_v4_2_comm\Solutions\STM32Stamp\TinyCLR>ād:\gcc\bin\arm-none-eabi-gc
c.exeā -xc++ -Wno-invalid-offsetof -fcheck-new -fno-default-inline -mabi=aapcs
-ffunction-sections -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers
-fshort-wchar -fno-exceptions -funsigned-char -mstructure-size-boundary=8 -DTIN
YCLR_ENABLE_SOURCELEVELDEBUGGING -mthumb-interwork -DCOMPILE_THUMB -DVERSION_M
AJOR=4 -DVERSION_MINOR=2 -DVERSION_BUILD=0 -DVERSION_REVISION=0 -DOEMSYSTEMINFOS
TRING="āMicrosoft Copyright Ā© Microsoft Corporation. All rights reserved.ā"
-DPLATFORM_ARM_STM32 -DPLATFORM_ARM_STM32Stamp -DTARGETLOCATION_FLASH -DLITTLE_
ENDIAN -DGCC_V4_2 -DPLATFORM_EMULATED_FLOATINGPOINT=1 -DPLATFORM_NO_CLR_TRACE=1
-DTINYCLR_NO_APPDOMAINS=1 -DTINYCLR_NO_IL_INLINE=1 -mcpu=cortex-m3 -mlittle
-endian -g -O2 -DNDEBUG -ID:\MF\client_v4_2_comm\DeviceCode\Cores\arm\Processo
rs\ARM9\Bootstrap -ID:\MF\client_v4_2_comm\DeviceCode\include -ID:\MF\client_v4_
2_comm\DeviceCode\Cores\arm -ID:\MF\client_v4_2_comm\Support\Include -ID:\MF\c
lient_v4_2_comm\crypto\inc -ID:\MF\client_v4_2_comm\CLR\Include -ID:\MF\client_
v4_2_comm\CLR\Libraries\CorLib -ID:\MF\client_v4_2_comm\CLR\Libraries\SPOT -ID:
MF\client_v4_2_comm\CLR\Libraries\SPOT_Hardware -ID:\MF\client_v4_2_comm\CLR\Lib
raries\SPOT_Graphics -ID:\MF\client_v4_2_comm\CLR\Libraries\SPOT_Net -Id:\gcc\li
b\gcc\arm-none-eabi\include -ID:\MF\client_v4_2_comm\Solutions\STM32Stamp -ID:
MF\client_v4_2_comm\devicecode\Targets\Native\STM32 -ID:\MF\client_v4_2_comm\Dev
iceCode\Cores\arm -ID:\MF\client_v4_2_comm\DeviceCode\Cores\arm\Include -ID:\MF
client_v4_2_comm\DeviceCode -ID:\MF\client_v4_2_comm\DeviceCode\Include -ID:\MF
client_v4_2_comm\CLR\Include -ID:\MF\client_v4_2_comm\DeviceCode\Targets\Native
STM32\STM32Stamp -ID:\MF\client_v4_2_comm\Support\Include -ID:\MF\client_v4_2_co
mm\DeviceCode\include -ID:\MF\client_v4_2_comm\CLR\include -ID:\MF\client_v4_2_c
omm\Crypto\inc -Wabi -o D:\MF\client_v4_2_comm\BuildOutput\thumb\GCC4.2\le\F
LASH\release\STM32Stamp\obj\DeviceCode\Cores\arm\Processors\ARM9\Bootstrap\ARM9_
bootstrap.obj -c D:\MF\client_v4_2_comm\DeviceCode\Cores\arm\Processors\ARM9\Boo
tstrap\ARM9_bootstrap.cpp
D:\MF\client_v4_2_comm\DeviceCode\Cores\arm\Processors\ARM9\Bootstrap\ARM9_boots
trap.cpp:1: error: target CPU does not support ARM mode[/quote]
I suspect that GCC has never been used for Cortex CPUsā¦
iMX_thumb compiles, but itās CPU does support not Thumb modeā¦
The last line:
Is referencing ARM9 Bootstrap and it shouldnt I thinkā¦
Yes, but you have narrowed it down to the known problem.
Look at C:\MicroFrameworkPK_v4_1\tools\Targets\Microsoft.Spot.system.gcc.targets
Yes correct.
This should be called āComunity Compilationā
I changed in Microsoft.Spot.system.gcc.targets:
From:
To:
From:
To:
[quote]<CC_CPP_COMMON_FLAGS Condition=āā$(INSTRUCTION_SET)ā==āthumb2āā >$(CC_CPP_COMMON_FLAGS) -DCOMPILE_THUMB2 -mthumb </CC_CPP_COMMON_FLAGS>
[/quote]
After that I can change the instruction set back to thumb2 and get a lot furtherā¦
Now I get:
[quote]D:\MF\client_v4_2_comm\DeviceCode\Targets\Native\STM32\DeviceCode\STM32_Time\STM
32_Time_functions.cpp:176: error: integer constant is too large for ālongā type[/quote]
The line is:
static UINT64 g_nextEvent; // tick time of next event to be scheduled
g_nextEvent = 0xFFFFFFFFFFFF; // never
UINT64 is typedefed as
typedef unsigned long long int UINT64;
The error was related to 0xFFFFFFFFFFFF being to big for and int, doesnāt matter that you are putting it in a long long.
Replaced with this, now it works:
#ifdef __GNUC__
g_nextEvent = 0xFFFFFFFFFFFFLL; // never
#else
g_nextEvent = 0xFFFFFFFFFFFF; // never
#endif
On too next error.
error: invalid conversion from āuint32_t*ā to 'UINT32*