Terstegge / mbed-os-MSP432

Apache License 2.0
7 stars 0 forks source link

USBTX, USBRX were not declared in this scope #1

Closed rei-vilo closed 3 years ago

rei-vilo commented 3 years ago

Compile fails with an error on USBTX, USBRX.

mbed --version gives 1.10.4

mbed import https://github.com/Terstegge/mbed-os-MSP432.git
cd mbed-os-MSP432
mbed config GCC_ARM_PATH /home/USER/tools/arm-none-eabi-gcc/6.3.1-20170620/bin
mbed compile -v
Compile: /home/USER/tools/arm-none-eabi-gcc/6.3.1-20170620/bin/arm-none-eabi-g++ -c -std=gnu++14 -fno-rtti -Wvla -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -MMD -fomit-frame-pointer -Os -g -DMBED_TRAP_ERRORS_ENABLED=1 -DMBED_RTOS_SINGLE_THREAD -D__NEWLIB_NANO -DMBED_MINIMAL_PRINTF -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -DMBED_ROM1_START=0x200000 -DMBED_ROM1_SIZE=0x4000 -DMBED_ROM_START=0x0 -DMBED_ROM_SIZE=0x40000 -DMBED_RAM_START=0x20000000 -DMBED_RAM_SIZE=0x10000 -DMBED_RAM1_START=0x1000000 -DMBED_RAM1_SIZE=0x10000 -DTARGET_RELEASE -DDEVICE_ANALOGIN=1 -DDEVICE_I2CSLAVE=1 -D__CMSIS_RTOS -DTARGET_LIKE_MBED -DTARGET_MSP432P401R -DTARGET_CORTEX -D__MBED__=1 -DDEVICE_USTICKER=1 -DDEVICE_I2C=1 -DDEVICE_SPI_ASYNCH=1 -DDEVICE_SPI=1 -DTARGET_LIKE_CORTEX_M4 -DDEVICE_SPISLAVE=1 -DMBED_BUILD_TIMESTAMP=1622381877.1743395 -DTARGET_TI -DTARGET_MSP432 -DDEVICE_PWMOUT=1 -DTARGET_NAME=MSP432_LAUNCHPAD -DTARGET_FF_LAUNCHPAD_40 -DDEVICE_PORTINOUT=1 -DDEVICE_PORTIN=1 -DDEVICE_SERIAL=1 -D__FPU_PRESENT=1 -DDEVICE_PORTOUT=1 -D__MBED_CMSIS_RTOS_CM -DTOOLCHAIN_GCC -D__MSP432P401R__ -DTARGET_RTOS_M4_M7 -DMBED_MPU_CUSTOM -D__CORTEX_M4 -DTOOLCHAIN_GCC_ARM -DDEVICE_STDIO_MESSAGES=1 -DTARGET_M4 -DDEVICE_INTERRUPTIN=1 -DDEVICE_I2C_ASYNCH=1 -DTARGET_CORTEX_M -DTARGET_MSP432_LAUNCHPAD -DARM_MATH_CM4 @./BUILD/MSP432_LAUNCHPAD/GCC_ARM/.includes_96de59c41b6e675a5596460951e6a288.txt -include ./BUILD/MSP432_LAUNCHPAD/GCC_ARM/mbed_config.h -MD -MF BUILD/MSP432_LAUNCHPAD/GCC_ARM/mbed-os/hal/source/mbed_pinmap_default.d -o BUILD/MSP432_LAUNCHPAD/GCC_ARM/mbed-os/hal/source/mbed_pinmap_default.o ./mbed-os/hal/source/mbed_pinmap_default.cpp
[Error] mbed_pinmap_default.cpp@72,9: 'USBTX' was not declared in this scope
[Error] mbed_pinmap_default.cpp@72,16: 'USBRX' was not declared in this scope
[DEBUG] Return: 1
[DEBUG] Output: ./mbed-os/hal/source/mbed_pinmap_default.cpp: In function 'const PinList* pinmap_restricted_pins()':
[DEBUG] Output: ./mbed-os/hal/source/mbed_pinmap_default.cpp:72:9: error: 'USBTX' was not declared in this scope
[DEBUG] Output:          USBTX, USBRX
[DEBUG] Output:          ^~~~~
[DEBUG] Output: ./mbed-os/hal/source/mbed_pinmap_default.cpp:72:16: error: 'USBRX' was not declared in this scope
[DEBUG] Output:          USBTX, USBRX
[DEBUG] Output:                 ^~~~~
Traceback (most recent call last):
  File "/home/USER/Mbed Programs/mbed-os-MSP432/mbed-os/tools/toolchains/mbed_toolchain.py", line 559, in compile_queue
    res['command']
  File "/home/USER/Mbed Programs/mbed-os-MSP432/mbed-os/tools/toolchains/mbed_toolchain.py", line 684, in compile_output
    raise ToolException(stderr)
tools.utils.ToolException: ./mbed-os/hal/source/mbed_pinmap_default.cpp: In function 'const PinList* pinmap_restricted_pins()':
./mbed-os/hal/source/mbed_pinmap_default.cpp:72:9: error: 'USBTX' was not declared in this scope
         USBTX, USBRX
         ^~~~~
./mbed-os/hal/source/mbed_pinmap_default.cpp:72:16: error: 'USBRX' was not declared in this scope
         USBTX, USBRX
                ^~~~~

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/USER/Mbed Programs/mbed-os-MSP432/mbed-os/tools/make.py", line 76, in wrapped_build_project
    *args, **kwargs
  File "/home/USER/Mbed Programs/mbed-os-MSP432/mbed-os/tools/build_api.py", line 618, in build_project
    objects = toolchain.compile_sources(resources, sorted(resources.get_file_paths(FileType.INC_DIR)))
  File "/home/USER/Mbed Programs/mbed-os-MSP432/mbed-os/tools/toolchains/mbed_toolchain.py", line 418, in compile_sources
    return self._compile_sources(resources, inc_dirs=inc_dirs)
  File "/home/USER/Mbed Programs/mbed-os-MSP432/mbed-os/tools/toolchains/mbed_toolchain.py", line 495, in _compile_sources
    return self.compile_queue(queue, objects)
  File "/home/USER/Mbed Programs/mbed-os-MSP432/mbed-os/tools/toolchains/mbed_toolchain.py", line 566, in compile_queue
    raise ToolException(err)
tools.utils.ToolException: ./mbed-os/hal/source/mbed_pinmap_default.cpp: In function 'const PinList* pinmap_restricted_pins()':
./mbed-os/hal/source/mbed_pinmap_default.cpp:72:9: error: 'USBTX' was not declared in this scope
         USBTX, USBRX
         ^~~~~
./mbed-os/hal/source/mbed_pinmap_default.cpp:72:16: error: 'USBRX' was not declared in this scope
         USBTX, USBRX
                ^~~~~

[mbed] ERROR: "/home/USER/.config/Mbed Studio/mbed-studio-tools/python/bin/python" returned error.
       Code: 1
       Path: "/home/USER/Mbed Programs/mbed-os-MSP432"
       Command: "/home/USER/.config/Mbed Studio/mbed-studio-tools/python/bin/python -u /home/USER/Mbed Programs/mbed-os-MSP432/mbed-os/tools/make.py -t GCC_ARM -m MSP432_LAUNCHPAD --source . --build ./BUILD/MSP432_LAUNCHPAD/GCC_ARM -v"
---

Thank you!

Terstegge commented 3 years ago

This is probably due to the renaming of the standard UART RX/TX Pins in the last mbed release. I will look into this and provide a fix..

Terstegge commented 3 years ago

I forgot to update mbed-os.lib in the last release. I just fixed this with the last commit. Please try again and thank you very much for pointing this out! Feels good to have the first issue after several months:)

rei-vilo commented 3 years ago

Thank you, it works fine now.