2013-03-19 01:54 AM
2013-03-25 02:54 AM
I'm from Spain ;)
Sorry, slightly off ... my Spanish is not better. But the languages are similiar, and allow for basic intermixed communication.I'm sure it's easier to use a supported environment.
When using the IAR trial every was simpler, all examples run well, included examples with simplemac library, but i can not afford to pay a license.
I can understand those companies. Barely visible at first glance, the seamless integration of all the different MCU's is hard and tedious work. They are not willing to give everything away for free. With a free toolchain, you will have to do that work for yourself. They are only free if you don't value the extra time spend. A second, similiar problem will probably cause much less pain, once you know the way. But for another MCU, you can budget for the same effort and time spent. Alternatively, you may consider a limited licence of a commercial toolchain. Keil is said to offer an affordable one with a 256k restriction, CodeRed too. Not heard such thing of IAR. And Rowley/Crossworks has an affordable private licence.
2013-03-25 03:41 AM
I hope you realize that
wchar_t
is not a C datatype, but just atypedef
'd reference. Any *_t datatype is system-dependant. And it is usually not defined inside you packet, but in a system header file of your toolchain. So your wchar_t datatype might have a size issue, and possibly a signedness issue. When you don't have the source for your library, you will need change that typedef for your project. Can't you use the debugger to tackle the problem ? Does halInit() bail out, or does it crash ?2013-03-25 07:45 AM
When I began to debug into the function halInit(); I realize that makes several calls to functions that do not encounter such as:
halInit();-->halInternalInitAdc();-->stCalibrateVref(); halInit();-->halCommonCalibratePads();-->halMeasureVdd(); In both cases jump to HardFault_Handler();2013-03-25 11:43 AM
As mentioned at the start, I neither have the simpleMac librarynor the board, so I'm unable to verify anything.
On *NIX systems, I would use thenm
command to list the contents of the lib - not sure how if your toolchain has some ported version, or another tool. But briefly googling for that lib, and looking at the doc, I've seen it is intended for two different boards. Not sure how the lib handles the hardware differences on the lowest layer (i.e. the functions you are missing). On source level, there is usually a #define to specify the target hardware, and differ between those versions. Maybe you need to define one of those in your code/project ? I wonder that you don't get a linker error. Does you project link in some__weak
, empty versions for this functions ?2013-03-26 01:32 AM
2013-03-26 06:34 AM
Actually, it supports more than two boards - see CD00262339.pdf
(MB850A, MB851, MB954, MB950A + MB953, MB951).I never used nm comand, but in the out.txt file you can see the output of the command arm-none-eabi-nm simplemac-library.aThat's fine, and it reveals that those functions like stCalibrateVref() are present in the lib. I can't see an obvious reason to hardfault. But I've seen one thing suspicious. The lib contains entries like __iar_cc..eSdGjFFTt$1 and __iar_systems$$module. Not sure what they are good for, but generally the source differs between an IAR branch and a GNU branch. There is even a GNU version of the lib, as seen here:AFAIK Codsourcery is basically some Gnu variant, so I would also go for the Gnu variant of the library to link in. Otherwise, I would try the debugging approach, and check where it actually fails. I wouldn't wonder if it had to do with this mentioned IAR functions. I don't use IAR, so I'm not an expert here.
2013-03-26 07:33 AM
2013-03-26 08:03 AM
if i change the simplemac-library.a for simplemac-library-gnu.a
Output: arm-none-eabi-ld -nostartfiles -static -T Projects\SimpleMAC\talk\/link.ld -M -Map=talk.map --gc-sections -L /CodeSourcery/CodeSourcery20120963/arm-none-eabi/lib/thumb2 -L /CodeSourcery/CodeSourcery20120963/lib/gcc/arm-none-eabi/4.7.2/thumb2 -L SimpleMAC/Binary -o talk.axf obj/startup.o obj/context-switch.o obj/talk.o obj/syscalls.o obj/stm32w108xx_it.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_adc.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_clk.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_exti.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_flash.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_gpio.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_misc.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_pwr.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_rst.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_sc.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_slptim.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_tim.o STM32W108xx_StdPeriph_Driver/obj/stm32w108xx_wdg.o STM32W108xx_StdPeriph_Driver/obj/system_stm32w108xx.o Utilities/STM32_EVAL/Common/obj/mbxxx_adc_tsensor.o Utilities/STM32_EVAL/Common/obj/mbxxx_i2c_ee.o Utilities/STM32_EVAL/Common/obj/mbxxx_i2c_lis302dl.o Utilities/STM32_EVAL/MB851/obj/mb8o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/board.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/hal_adc.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/hal_clocks.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/hal_flash.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/hal_uart.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/mfg-token.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/micro.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/micro-common.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/micro-common-internal.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/nvm.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/sleep.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/system-timer.o Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/stm32w108/low_level_init.o --start-group -lc -lgcc -lsimplemac-library-gnu --end-group obj/talk.o: In function `powerFromBatteries': Projects\SimpleMAC\talk\/talk.c:375: undefined reference to `halMeasureVdd' Projects\SimpleMAC\talk\/talk.c:382: undefined reference to `halMeasureVdd' Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/hal_adc.o: In function `halInternalInitAdc': Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/hal_adc.c:257: undefined reference to `stCalibrateVref' Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/obj/micro-common-internal.o: In function `halCommonCalibratePads': Utilities/STM32W108xx_HAL_Driver/micro/cortexm3/micro-common-internal.c:71: undefined reference to `halMeasureVdd' SimpleMAC/Binary\libsimplemac-library-gnu.a(phy-min.o): In function `readAdcTemperatureChannel': J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xx/phy.c:868: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xx/phy.c:873: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xx/phy.c:874: undefined reference to `calDisableAdc' SimpleMAC/Binary\libsimplemac-library-gnu.a(phy-min.o): In function `stmRadioGetRandomNumbers': J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xx/phy.c:820: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xx/phy.c:829: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xx/phy.c:830: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xx/phy.c:841: undefined reference to `calDisableAdc' SimpleMAC/Binary\libsimplemac-library-gnu.a(analogue-min.o): In function `stmRadioSetChannel': J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue.c:900: undefined reference to `calDisableAdc' SimpleMAC/Binary\libsimplemac-library-gnu.a(analogue-lna-min.o): In function `stmRadioCalibrateLna': J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:235: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:240: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:241: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:246: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:275: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:286: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:293: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:302: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:310: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:316: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:356: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:362: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:416: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-lna.c:422: undefined reference to `calReadAdcBlocking' SimpleMAC/Binary\libsimplemac-library-gnu.a(analogue-mod-dac-min.o): In function `vcoTuneModDacError': J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-mod-dac.c:90: undefined reference to `calDisableAdc' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-mod-dac.c:97: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-mod-dac.c:102: undefined reference to `calReadAdcBlocking' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-mod-dac.c:114: undefined reference to `calDisableAdc' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-mod-dac.c:123: undefined reference to `calStartAdcConversion' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/analogue-mod-dac.c:128: undefined reference to `calReadAdcBlocking' SimpleMAC/Binary\libsimplemac-library-gnu.a(phy-common-min.o): In function `stmRadioWakeUp': J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/phy-common.c:658: undefined reference to `_disableBasePri' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/phy-common.c:658: undefined reference to `_writeBasePri' SimpleMAC/Binary\libsimplemac-library-gnu.a(phy-common-min.o): In function `stmRadioSleep': J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/phy-common.c:554: undefined reference to `_disableBasePri' J:\ccviews\stm32w-dev\simplemac\source/stack/phy/stm32w108xxclass/phy-common.c:648: undefined reference to `_writeBasePri' SimpleMAC/Binary\libsimplemac-library-gnu.a(aes-min.o): In function `stmAesEncrypt': J:\ccviews\stm32w-dev\simplemac\source/stack/platform/micro/cortexm3/aes.c:80: undefined reference to `_disableBasePri' J:\ccviews\stm32w-dev\simplemac\source/stack/platform/micro/cortexm3/aes.c:80: undefined reference to `_writeBasePri' make: *** [talk.axf] Error 1 And the nm comand return out.txt ________________ Attachments : out.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtYd&d=%2Fa%2F0X0000000aRi%2FSTYOt_pxRtcpdjp9A1WCN1MjLunzkPDOmYAtW_CMgiI&asPdf=false2013-03-26 08:18 AM
That seems to require the files in .../simpleMAC/Utilities/STM32W108xx_HAL_Driver/micro/cortexm3. Did you include it in your project ?
As I understood it, the lowest level functionality (HAL layer) is not included in the lib, so you can easily make adaptions.2013-03-26 08:18 AM
Double post, freaking forum software ;-(((