ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.67k stars 2.98k forks source link

CLI export to SW4STM32 fails on OSX #5804

Closed Hoel closed 6 years ago

Hoel commented 6 years ago

Description


Bug

Target ALL

Toolchain: GCC_ARM

When i build blinky project with CLI everything works fine, when i try to export the same project for SW4STM32 it fails. This is a custom target (LORAM3_L151C8) but i also tried with already include targets, same result. The mbed blinky project has been downloaded on 19/12 from CLI.

iMac-de-Hoel-2:mbed-os-example-blinky hoel$ mbed compile -m LORAM3_L151C8 -t GCC_ARM
Building project mbed-os-example-blinky (LORAM3_L151C8, GCC_ARM)
Scan: .
Scan: mbed
Scan: env
Elf2Bin: mbed-os-example-blinky
+------------------+-------+-------+------+
| Module           | .text | .data | .bss |
+------------------+-------+-------+------+
| [fill]           |    56 |     8 |    8 |
| [lib]/c.a        | 24364 |  2204 |   56 |
| [lib]/gcc.a      |  4512 |     0 |    0 |
| [lib]/m.a        |    80 |     0 |    0 |
| [lib]/misc       |   228 |    16 |   28 |
| main.o           |    72 |     4 |   28 |
| mbed-os/drivers  |   136 |     4 |  100 |
| mbed-os/hal      |   889 |     0 |   26 |
| mbed-os/platform |  1384 |     4 |  270 |
| mbed-os/rtos     |  8457 |   180 | 5988 |
| mbed-os/targets  |  7082 |     4 |  416 |
| Subtotals        | 47260 |  2424 | 6920 |
+------------------+-------+-------+------+
Total Static RAM memory (data + bss): 9344 bytes
Total Flash memory (text + data): 49684 bytes

Image: ./BUILD/LORAM3_L151C8/GCC_ARM/mbed-os-example-blinky.bin
iMac-de-Hoel-2:mbed-os-example-blinky hoel$ mbed export -i sw4stm32 -m LORAM3_L151C8
Scan: .

Create a System Workbench for STM32 managed project
Project name: mbed-os-example-blinky
Target:       LORAM3_L151C8
Toolchain:    GCC_ARM

Symbols: 40
Include folders: 58
Source folders: 30, with 58 exclusions
Exclude folders: 58
Linker script:   mbed-os/targets/TARGET_STM/TARGET_STM32L1/TARGET_LORAM3_L151C8/device/TOOLCHAIN_GCC_ARM/STM32L151XC.ld
Traceback (most recent call last):
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/project.py", line 259, in <module>
    main()
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/project.py", line 254, in main
    build_profile=profile, app_config=options.app_config)
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/project.py", line 96, in export
    app_config=app_config)
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/export/__init__.py", line 342, in export_project
    macros=macros)
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/export/__init__.py", line 207, in generate_project_files
    exporter.generate()
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/export/sw4stm32/__init__.py", line 519, in generate
    'board_name': self.BOARDS[self.target.upper()]['name'],
KeyError: 'LORAM3_L151C8'
[mbed] ERROR: "/usr/bin/python" returned error code 1.
[mbed] ERROR: Command "/usr/bin/python -u /Users/hoel/mbed-os-example-blinky/mbed-os/tools/project.py -i sw4stm32 -m LORAM3_L151C8 --source ." in "/Users/hoel/mbed-os-example-blinky"
iMac-de-Hoel-2:mbed-os-example-blinky hoel$
0xc0170 commented 6 years ago

Based on the errors in the traceback, seems that board is not in the list, the exception might be handled to provide a log that a board is not supported (can help during offline development).

To add a support, you should add your target to BOARDS dictionary.

@ARMmbed/team-st-mcd

Hoel commented 6 years ago

To add a support, you should add your target to BOARDS dictionary.

It is in targets.json and has a folder. also as told I tried other existing targets (XDOT_L151CC and others) with the same result, the custom target is in targets.json, has a folder, can compile and the binary works.

iMac-de-Hoel-2:mbed-os-example-blinky hoel$ mbed export -i sw4stm32 -m XDOT_L151CC
Scan: .

Create a System Workbench for STM32 managed project
Project name: mbed-os-example-blinky
Target:       XDOT_L151CC
Toolchain:    GCC_ARM

Symbols: 40
Include folders: 58
Source folders: 30, with 58 exclusions
Exclude folders: 58
Linker script:   mbed-os/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/TOOLCHAIN_GCC_ARM/STM32L151XC.ld
Traceback (most recent call last):
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/project.py", line 259, in <module>
    main()
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/project.py", line 254, in main
    build_profile=profile, app_config=options.app_config)
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/project.py", line 96, in export
    app_config=app_config)
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/export/__init__.py", line 342, in export_project
    macros=macros)
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/export/__init__.py", line 207, in generate_project_files
    exporter.generate()
  File "/Users/hoel/mbed-os-example-blinky/mbed-os/tools/export/sw4stm32/__init__.py", line 519, in generate
    'board_name': self.BOARDS[self.target.upper()]['name'],
KeyError: 'XDOT_L151CC'
[mbed] ERROR: "/usr/bin/python" returned error code 1.
[mbed] ERROR: Command "/usr/bin/python -u /Users/hoel/mbed-os-example-blinky/mbed-os/tools/project.py -i sw4stm32 -m XDOT_L151CC --source ." in "/Users/hoel/mbed-os-example-blinky"
0xc0170 commented 6 years ago

https://github.com/ARMmbed/mbed-os/blob/master/tools/export/sw4stm32/__init__.py#L36 - this is where those targets should be added to enable the exporter

If you search there, you find that those 2 targets you tested are not present in the boards supported dictionary.

Hoel commented 6 years ago

OK thank you it works now indeed. I import the project in SW4STM32 (the target is a STM32F303CC board here) but it cannot compile, error from assembler, no idea what this temporary assembler file is /var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//ccbMLbhB.s I should add a flag for GCC when exporting?

arm-none-eabi-gcc -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -std=c99 '-DMBED_BUILD_TIMESTAMP=1515413755.5' '-D__MBED__=1' '-DDEVICE_I2CSLAVE=1' '-D__FPU_PRESENT=1' '-DRTC_LSI=0' '-DDEVICE_PORTINOUT=1' -DTARGET_RTOS_M4_M7 '-DDEVICE_LOWPOWERTIMER=1' '-DDEVICE_RTC=1' -DTOOLCHAIN_object -D__CMSIS_RTOS -DTARGET_STM32F303 -DTOOLCHAIN_GCC '-DDEVICE_CAN=1' -DTARGET_CORTEX_M -DTARGET_DEBUG '-DDEVICE_I2C_ASYNCH=1' -DTARGET_LIKE_CORTEX_M4 '-DDEVICE_ANALOGOUT=1' -DTARGET_M4 -DTARGET_UVISOR_UNSUPPORTED '-DDEVICE_PORTOUT=1' '-DDEVICE_SPI_ASYNCH=1' '-DDEVICE_SERIAL=1' -DTARGET_STM32F303CC -DTARGET_CORTEX '-DDEVICE_I2C=1' '-DTRANSACTION_QUEUE_SIZE_SPI=2' -D__CORTEX_M4 '-DDEVICE_STDIO_MESSAGES=1' -DTARGET_FAMILY_STM32 -DTARGET_STM32F303xC '-DDEVICE_PORTIN=1' -DTARGET_LORAM3_F303CC -DTARGET_STM '-DDEVICE_SERIAL_FC=1' -DTARGET_LIKE_MBED -D__MBED_CMSIS_RTOS_CM '-DDEVICE_SLEEP=1' -DTOOLCHAIN_GCC_ARM '-DDEVICE_SPI=1' '-DDEVICE_INTERRUPTIN=1' '-DDEVICE_SPISLAVE=1' -DTARGET_STM32F3 '-DDEVICE_ANALOGIN=1' '-DDEVICE_PWMOUT=1' -DARM_MATH_CM4 -DMBED_DEBUG '-DMBED_TRAP_ERRORS_ENABLED=1' -DMBED_DEBUG '-DMBED_TRAP_ERRORS_ENABLED=1' -DNDEBUG -DNDEBUG -I"/Users/hoel/mbed-os-example-blinky" -I"/Users/hoel/mbed-os-example-blinky/img" -I"/Users/hoel/mbed-os-example-blinky/mbed-os" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/cmsis" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/cmsis/TARGET_CORTEX_M" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/cmsis/TARGET_CORTEX_M/TOOLCHAIN_GCC" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/cmsis/TOOLCHAIN_GCC" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/drivers" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/events" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/events/equeue" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/filesystem" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/filesystem/bd" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/filesystem/fat" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/filesystem/fat/ChaN" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/greentea-client" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/greentea-client/greentea-client" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/greentea-client/source" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/unity" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/unity/source" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/unity/unity" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/utest" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/utest/source" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/utest/utest" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/importer" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/inc" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/inc/mbedtls" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/platform" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/platform/inc" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/platform/src" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/src" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/targets" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/targets/TARGET_STM" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/nanostack" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/netsocket" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/netsocket/cellular" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/netsocket/cellular/generic_modem_driver" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/netsocket/cellular/utils" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/storage" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/hal" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/hal/storage_abstraction" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/platform" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX/rtx4" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX/rtx5" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX/rtx5/TARGET_RTOS_M4_M7" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX/rtx5/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F3" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F3/device" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/device" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/device/TOOLCHAIN_GCC_ARM" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/TARGET_LORAM3_F303CC" -I"/Users/hoel/mbed-os-example-blinky"  -include/Users/hoel/mbed-os-example-blinky/mbed_config.h -O2 -funsigned-char -fno-delete-null-pointer-checks -fomit-frame-pointer -fmessage-length=0 -fno-builtin -g3 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -ffunction-sections -fdata-sections -c -MMD -MP -MF"mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_cortex.d" -MT"mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_cortex.o" -o "mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_cortex.o" "../mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_cortex.c"
In file included from ../mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_rcc.h:47:0,
                 from ../mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_conf.h:183,
                 from ../mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal.h:48,
                 from ../mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_cortex.c:127:
../mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_def.h: In function 'atomic_set_u32':
../mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_def.h:132:24: warning: implicit declaration of function '__LDREXW' [-Wimplicit-function-declaration]
   newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
                        ^~~~~~~~
../mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_def.h:134:11: warning: implicit declaration of function '__STREXW' [-Wimplicit-function-declaration]
  } while (__STREXW(newValue,(volatile unsigned long*) ptr));
           ^~~~~~~~
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//ccbMLbhB.s: Assembler messages:
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//ccbMLbhB.s:295: Error: selected processor does not support `dsb 0xF' in Thumb mode
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//ccbMLbhB.s:306: Error: selected processor does not support `isb 0xF' in Thumb mode
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//ccbMLbhB.s:351: Error: selected processor does not support `dsb 0xF' in Thumb mode
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//ccbMLbhB.s:372: Error: selected processor does not support `dsb 0xF' in Thumb mode
make: *** [mbed-os/targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_cortex.o] Error 1
0xc0170 commented 6 years ago

It should work out of the box, are you using your own GCC ARM installation or provided by stm32 ide?

@ARMmbed/team-st-mcd Do you recognize the errors above?

adustm commented 6 years ago

Dear @Hoel

I cannot help for your private target, but I've tried the closest STM device, the STM32F303VC that is on the DISCO_F303VC. I did: mbed export -i sw4stm32 -m DISCO_F303VC Then I've imported the directory mbed-os-example-blinky in System Workbench (File... Import... from an existing project... select the directory) and builded the project. It compiles and link prefectly.

Generating binary and Printing size information:
arm-none-eabi-objcopy -O binary "mbed-os-example-blinky-debug.elf" "mbed-os-example-blinky.bin"
arm-none-eabi-size -B "mbed-os-example-blinky-debug.elf"
   text    data     bss     dec     hex filename
  26032    2316    7228   35576    8af8 mbed-os-example-blinky-debug.elf

Could you also try that and tell us if it works for you ?

Hoel commented 6 years ago

@0xc0170 i use the GCC ARM provided by SW4STM32 indeed. Also the projects i export from mbed online (as SW4STM32 project) are imported and working fine in SW4STM32 (after small project properties tweaking). The SW4STM32 project generated by CLI also has broken project properties, when i open them i got errors in SW4STM32 and i cannot access the C/C++ build settings at all which is weird since projects exported from online compiler dont have this problem. N.B. i use File/open project from filesystem

capture d ecran 2018-01-08 a 18 39 20 capture d ecran 2018-01-08 a 18 39 20 capture d ecran 2018-01-08 a 18 39 11 @adustm I just tried with DISCO_F303VC and it worked, actually i used this very folder to make mine (attached), what could be wrong then? TARGET_LORAM3_F303CC.zip entry in inti.py

        'LORAM3_F303CC':
        {
            'name': 'LORAM3_F303CC',
            'mcuId': 'STM32F303CCT6'
        },

entry in targets.json

    "LORAM3_F303CC": {
        "inherits": ["FAMILY_STM32"],
        "core": "Cortex-M4F",
        "extra_labels_add": ["STM32F3", "STM32F303", "STM32F303xC", "STM32F303CC"],
        "macros_add": ["RTC_LSI=0"],
        "supported_toolchains": ["GCC_ARM"],
        "device_has_add": ["ANALOGOUT", "CAN", "LOWPOWERTIMER", "SERIAL_FC"],
        "device_name": "STM32F303CC"
    },

N.B. i can reproduced the issue, each time i export my target it does export well, same output in CLI as DISCO_F303VC, project imports fine in SW4STM32, but it is broken with errors in project properties and at build (build errors probably comes from the broken project properties).

N.B.2 i can reproduce the issue with other custom targets (i have 3 custom targets, all made from existing target folders of very close variants), for F103CB, it compiles with no warning and shows similar assembler related issues, so clearly, the error comes when i use custom targets, which compile and produce working binaries otherwise.

Building file: ../mbed-os/targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_cortex.c
Invoking: MCU GCC Compiler
/Users/hoel/mbed-os-example-blinky/Debug
arm-none-eabi-gcc -mthumb -mfloat-abi=soft -std=c99 '-DMBED_BUILD_TIMESTAMP=1515446655.99' '-D__MBED__=1' '-DDEVICE_I2CSLAVE=1' -DTARGET_LIKE_MBED '-DDEVICE_PORTOUT=1' -DTARGET_LORAM3_F103CB '-DDEVICE_PORTINOUT=1' -D__MBED_CMSIS_RTOS_CM -DTARGET_STM32F1 -DTOOLCHAIN_object -D__CMSIS_RTOS -DTOOLCHAIN_GCC '-DDEVICE_I2C_ASYNCH=1' -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DTARGET_DEBUG -DARM_MATH_CM3 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M3 '-DDEVICE_SERIAL=1' '-DDEVICE_SPI_ASYNCH=1' '-DDEVICE_INTERRUPTIN=1' -DTARGET_CORTEX '-DDEVICE_I2C=1' '-DTRANSACTION_QUEUE_SIZE_SPI=2' -D__CORTEX_M3 -DTARGET_FAMILY_STM32 -DTARGET_STM32F103CB -DTARGET_STM '-DDEVICE_PORTIN=1' '-DDEVICE_SLEEP=1' -DTOOLCHAIN_GCC_ARM '-DDEVICE_SPI=1' '-DDEVICE_SPISLAVE=1' '-DDEVICE_ANALOGIN=1' '-DDEVICE_PWMOUT=1' -DMBED_DEBUG '-DMBED_TRAP_ERRORS_ENABLED=1' -DMBED_DEBUG '-DMBED_TRAP_ERRORS_ENABLED=1' -DNDEBUG -DNDEBUG -I"/Users/hoel/mbed-os-example-blinky" -I"/Users/hoel/mbed-os-example-blinky/Debug" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/drivers" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/events" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/events/equeue" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/filesystem" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/filesystem/bd" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/filesystem/fat" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/filesystem/fat/ChaN" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/frameworks" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/frameworks/greentea-client" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/frameworks/greentea-client/source" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/frameworks/unity" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/frameworks/unity/source" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/frameworks/utest" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/frameworks/utest/source" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/mbedtls" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/mbedtls/platform" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/mbedtls/platform/src" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/mbedtls/src" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/mbedtls/targets" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/mbedtls/targets/TARGET_STM" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/netsocket" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/netsocket/cellular" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/features/netsocket/cellular/generic_modem_driver" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/hal" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/platform" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/rtos" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/rtos/TARGET_CORTEX" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/rtos/TARGET_CORTEX/rtx4" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/rtos/TARGET_CORTEX/rtx5" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/targets" -I"/Users/hoel/mbed-os-example-blinky/Debug/mbed-os/targets/TARGET_STM" -I"/Users/hoel/mbed-os-example-blinky/img" -I"/Users/hoel/mbed-os-example-blinky/mbed-os" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/cmsis" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/cmsis/TARGET_CORTEX_M" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/cmsis/TARGET_CORTEX_M/TOOLCHAIN_GCC" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/cmsis/TOOLCHAIN_GCC" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/drivers" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/events" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/events/equeue" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/filesystem" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/filesystem/bd" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/filesystem/fat" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/filesystem/fat/ChaN" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/greentea-client" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/greentea-client/greentea-client" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/greentea-client/source" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/unity" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/unity/source" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/unity/unity" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/utest" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/utest/source" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/frameworks/utest/utest" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/importer" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/inc" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/inc/mbedtls" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/platform" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/platform/inc" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/platform/src" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/src" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/targets" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/mbedtls/targets/TARGET_STM" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/nanostack" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/netsocket" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/netsocket/cellular" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/netsocket/cellular/generic_modem_driver" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/netsocket/cellular/utils" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/features/storage" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/hal" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/hal/storage_abstraction" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/platform" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX/rtx4" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX/rtx5" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX/rtx5/TARGET_M3" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/rtos/TARGET_CORTEX/rtx5/TARGET_M3/TOOLCHAIN_GCC" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F1" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F1/device" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F1/TARGET_LORAM3_F103CB" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F1/TARGET_LORAM3_F103CB/device" -I"/Users/hoel/mbed-os-example-blinky/mbed-os/targets/TARGET_STM/TARGET_STM32F1/TARGET_LORAM3_F103CB/device/TOOLCHAIN_GCC_ARM" -I"/Users/hoel/mbed-os-example-blinky"  -include/Users/hoel/mbed-os-example-blinky/mbed_config.h -O2 -funsigned-char -fno-delete-null-pointer-checks -fomit-frame-pointer -fmessage-length=0 -fno-builtin -g3 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -ffunction-sections -fdata-sections -c -MMD -MP -MF"mbed-os/targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_cortex.d" -MT"mbed-os/targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_cortex.o" -o "mbed-os/targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_cortex.o" "../mbed-os/targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_cortex.c"
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//cc8LXGbF.s: Assembler messages:
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//cc8LXGbF.s:294: Error: selected processor does not support `dsb 0xF' in Thumb mode
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//cc8LXGbF.s:305: Error: selected processor does not support `isb 0xF' in Thumb mode
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//cc8LXGbF.s:350: Error: selected processor does not support `dsb 0xF' in Thumb mode
/var/folders/vc/y1vp6b092pv3rw5jtp88yc6r0000gn/T//cc8LXGbF.s:371: Error: selected processor does not support `dsb 0xF' in Thumb mode
make: *** [mbed-os/targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_cortex.o] Error 1
bcostm commented 6 years ago

Can you try with

        'LORAM3_F303CC':
        {
            'name': 'STM32F3DISCOVERY',
            'mcuId': 'STM32F303CCT6'
        },
Hoel commented 6 years ago

thank you, ok i try and report here

REPORT: it compiles fine and the project settings are working with this definition. I can see the target in project properties is the STM32F3DISCOVERY and thus the MCU variant, RAM and ROM mappings etc are wrong. Do I need to create a LORAM3_F303CC board in SW4STM32 and then use this board definition in init.py ?:

        'LORAM3_F303CC':
        {
            'name': 'LORAM3_F303CC',
            'mcuId': 'STM32F303CCT6'
        },

run/debug configuration is also broken: capture d ecran 2018-01-09 a 10 28 31 capture d ecran 2018-01-09 a 10 28 46

When i try to set run/debug configuration by hand, selecting "automated generation" as usual, it fails with java.io.IOException: capture d ecran 2018-01-09 a 10 35 04

adustm commented 6 years ago

I'm afraid you will need support from System Workbench. You could ask your questions on their forum here www.openstm32.org ? Maybe the generated makefiles are not well generated. You could compare them with the one generated for the DISCO_F303VC...

kind regards

Hoel commented 6 years ago

I will ask them, not sure they will deal the problem, it looks like an mbed CLI issue. The projects exported from online mbed compiler are working fine, they dont have these run/debug errors. The project exported from CLI with existing target : mbed export -i sw4stm32 -m DISCO_F303VC are also ok for run/debug, of course i cannot use it for actual target since MCU is not the same variant.

Maybe the generated makefiles are not well generated.

Makefiles are generated by the mbed CLI not SW4STM32 right? Only project exported from CLI with the custom target does exhibit the issue, how can this be related to SW4STM32? I think the problem is how the CLI handles custom targets, though custom target folder has been made by copying an existing target (DISCO_F303CV in this case).

Le 9 janv. 2018 à 10:44, Armelle DUBOC notifications@github.com a écrit :

I'm afraid you will need support from System Workbench. You could ask your questions on their forum here www.openstm32.org http://www.openstm32.org/ ? Maybe the generated makefiles are not well generated. You could compare them with the one generated for the DISCO_F303VC...

kind regards

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ARMmbed/mbed-os/issues/5804#issuecomment-356232669, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmBazTkRzFG96cnbdR6KK_8drGsnGSBks5tIzT5gaJpZM4RWMBi.

Hoel commented 6 years ago

follow up on the issue, i confirm the problem is on CLI export side, i have been able to setup a working project by exporting with

        'LORAM3_F303CC':
        {
            'name': 'STM32F3DISCOVERY',
            'mcuId': 'STM32F303CCT6'
        },

Which use STM32F3DISCOVERY' as target instead of my custom target (made from STM32F3DISCOVERY directory actually), when i use this definition the SW4STM32 project is working fine, but i have a to make numerous change in order to change for the correct target afterwards. To reproduce the issue:

bcostm commented 6 years ago

For me the SW4STM32 exporter is working fine. The problem for you is that SW4STM32 tool does not support custom boards which is normal I think...

Hoel commented 6 years ago

does SW4STM32 tool stands for SW4STM32 IDE or for mbed CLI SW4STM32 exporter? SW4STM32 does support custom target, we can create it from scratch with no issue in the target menu, and actually i have the LORAM3_F303CC in my targets tabs since i created it.

EDIT: after more tries, i got it to work, the problem was an underscore missing in the target name, once this fixed no more error in project properties.

I note something wrong with exported project, it does use mbed-os folder which is around 500Mo, compilation takes several minutes to complete. This problem does not occur when using project exported from online compiler, i noticed thoses project use the compact mbed folder rather than the huge mbed-os folder.

I am able to generate the compact mbed folder by building mbed-os with CLI, however i havent found how to force CLI to use this folder instead of mbed-os folder when exporting SW4STM32 project.

jeromecoutant commented 6 years ago

Hi

after more tries, i got it to work

I think we can close the issue ? Thx

Hoel commented 6 years ago

Hello, Sorry i havent worked on this lately, yes the export settings issue can be closed, problem is fixed by making sure custom target is created in SW4STM32 prior importing project and by adjusting project properties afterward (include path, config.h path, and few preprocessor defines).

There is still a big difference between a project exported from online compiler and from CLI, online compiler exported project result is including the mbed folder (obtained after building mbed-os with the specific target) which is small size and compile time is normal, CLI exported project includes the (huge +400mo) whole mbed-os folder and compile time is very long. Thanks

Le 24 janv. 2018 à 13:21, jcostm notifications@github.com a écrit :

Hi

after more tries, i got it to work

I think we can close the issue ? Thx

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ARMmbed/mbed-os/issues/5804#issuecomment-360113945, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmBa_wz0VWFSE5vtml-NXaZyax_N1ZOks5tNyBmgaJpZM4RWMBi.