Code Monkey home page Code Monkey logo

clion-embedded-arm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clion-embedded-arm's Issues

Redesign settings dialog

  • OpenOCD location -> OpenOCD home
  • Error indicators
  • Check for files/folders existence
  • Add .exe to executable names on Windows

Linker issue with DSP example Code

I generated a makefile using the plugin and a project for the STM32-L432KC. There are a lot of linker problems regarding the Drivers/CMSIS/DSP_Lib/Examples Folder, as far as i can see the examples are
all standalone programms. Is it possible to exclude this folder from the CMake by default?

Specifications

  • Plugin Version: 1.0.beta1
  • CLion version: 2017.3
  • STM32CubeMX version:4.23.0
  • Toolchain: arm-none-eabi-gcc
  • Platform: ubuntu 16.04-arm64

not in execute format: File Format not recognized when running debug

Expected Behavior

Debug normally.

Actual Behavior

Shows Firmware Download Success, but File Format not recognized as below:
image

And my gdb and openocd seems fine as below:

➜  openocd-bin-0.10.0-MacOS file /usr/local/bin/arm-none-eabi-gdb
/usr/local/bin/arm-none-eabi-gdb: Mach-O 64-bit executable x86_64
➜  openocd-bin-0.10.0-MacOS file local/bin/openocd
local/bin/openocd: Mach-O 64-bit executable x86_64

Run OpenOCD result:

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : tcl server disabled
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v22 API v2 SWIM v5 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.266974
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints

If I missed any settings ?

My settings are as below:
image
image
image

image

CMakeLists.txt

SET(CMAKE_SYSTEM_NAME Generic)
SET(CMAKE_SYSTEM_VERSION 1)
cmake_minimum_required(VERSION 3.7)

# specify the cross compiler
SET(CMAKE_C_COMPILER_WORKS 1)
SET(CMAKE_C_COMPILER arm-none-eabi-gcc)
SET(CMAKE_CXX_COMPILER arm-none-eabi-g++)


SET(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/STM32F401RETx_FLASH.ld)

#Uncomment for hardware floating point
#SET(FPU_FLAGS "-mfloat-abi=hard -mfpu=fpv4-sp-d16")
#add_definitions(-DARM_MATH_CM4 -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 )

#Uncomment for software floating point
#SET(FPU_FLAGS "-mfloat-abi=soft")

SET(COMMON_FLAGS "-mcpu=cortex-m4 ${FPU_FLAGS} -mthumb -mthumb-interwork -ffunction-sections -fdata-sections -g -fno-common -fmessage-length=0 -specs=nosys.specs -specs=nano.specs")

SET(CMAKE_CXX_FLAGS_INIT "${COMMON_FLAGS} -std=c++11")
SET(CMAKE_C_FLAGS_INIT "${COMMON_FLAGS} -std=gnu99")
SET(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-gc-sections -T ${LINKER_SCRIPT}")

PROJECT(f4-blog C ASM)
set(CMAKE_CXX_STANDARD 11)

#add_definitions(-DARM_MATH_CM4 -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 )
add_definitions(-D__weak=__attribute__\(\(weak\)\) -D__packed=__attribute__\(\(__packed__\)\) -DUSE_HAL_DRIVER -DSTM32F401xE )

file(GLOB_RECURSE SOURCES "startup/*.*" "Drivers/*.*" "Src/*.*" "Inc/*.*")

include_directories(Inc Drivers/STM32F4xx_HAL_Driver/Inc Drivers/STM32F4xx_HAL_Driver/Inc/Legacy Drivers/CMSIS/Device/ST/STM32F4xx/Include Drivers/CMSIS/Include)

add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT})

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map")

set(HEX_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hex)
set(BIN_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.bin)

add_custom_command(TARGET ${PROJECT_NAME}.elf POST_BUILD
        COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${PROJECT_NAME}.elf> ${HEX_FILE}
        COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${PROJECT_NAME}.elf> ${BIN_FILE}
        COMMENT "Building ${HEX_FILE}
Building ${BIN_FILE}")

add_custom_target(UPLOAD
        arm-none-eabi-gdb -iex "target remote tcp:127.0.0.1:3333"
        -iex "monitor program $<TARGET_FILE:${PROJECT_NAME}.elf>"
        -iex "monitor reset init"
        -iex "disconnect" -iex "quit")

Steps to Reproduce the Problem

  1. Run -> Build
  2. Set Breakpoint.
  3. Run -> Run OCD f4-blog : Firmware Download Success
  4. Run -> Debug OCD f4-blog
    image
    image

Specifications

  • Debugger: st-link
  • Board: ST Nuleo F401RE
  • Plugin Version: 1.0.beta1
  • CLion version: 2017.3.1
  • OpenOCD version: 0.10.0
  • GDB Version: GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
  • STM32CubeMX version: 4.23.0
  • Toolchain: arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
  • Platform: OS X Captain 10.11.6
  • Hardware configuration:

Make icons for the plugin and it's buttons

Icons to be done.

The icons should be done after shape of electronic chips, or embedded devices, or small CPU, or any electric circuit. Desired format: PNG or vector.

Existing examples:

https://github.com/elmot/clion-embedded-arm/tree/master/resources/xyz/elmot/clion/openocd

TBD

  • The Plugin itself [13*13px]
  • Run configuration [13*13px]
  • Update project action [16*16px]
  • Reset [16*16px]
  • Chip Erase [16*16px]
  • Run update project action [16*16px]

More documentation

Stateful AnAction?

xyz.elmot.clion.openocd.OpenOcdLauncher has an anonymous class which implicitly keeps his outer class. That might be a memory leak, according to #20

TODO: Check from IntelliJ guys if it is the real memory leak.

Detect Platform

Expected Behavior

Can the plugin detect automatically the platform (Linux or Windows) and set default platform path for OpenOCD ? Don't know if a standard path exist for OpenOCD installation on Windows.

Actual Behavior

Default to Linux (/usr)

Specifications

  • Plugin Version: 0.8 alpha
  • CLion version: 2017.3
  • Platform: Windows

Instead of global IDE notifications, use tool window notifications

ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project); if (toolWindowManager.canShowNotification(toolWindowId)) { //noinspection SSBasedInspection toolWindowManager.notifyByBalloon(toolWindowId, ...); }
where toolWindowId can be one of com.intellij.openapi.wm.ToolWindowId or a custom tool window

https://github.com/elmot/cubemx-clion/blob/ac7a2377e889ddb805a841b4a141e7354d9c832c/src/xyz/elmot/clion/openocd/OpenOcdRun.java#L154

Stacktrace if the board is suddenly disconnected

null
java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.execution.process.ProcessHandler$5.invoke(ProcessHandler.java:239)
	at com.sun.proxy.$Proxy19.onTextAvailable(Unknown Source)
	at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:213)
	at com.intellij.execution.process.BaseOSProcessHandler$SimpleOutputReader.onTextAvailable(BaseOSProcessHandler.java:295)
	at com.intellij.util.io.BaseOutputReader.sendText(BaseOutputReader.java:202)
	at com.intellij.util.io.BaseOutputReader.processInput(BaseOutputReader.java:186)
	at com.intellij.util.io.BaseOutputReader.readAvailableBlocking(BaseOutputReader.java:140)
	at com.intellij.util.io.BaseDataReader.readAvailable(BaseDataReader.java:85)
	at com.intellij.util.io.BaseDataReader.doRun(BaseDataReader.java:163)
	at com.intellij.util.io.BaseDataReader$1$1.run(BaseDataReader.java:66)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:194)
	at com.intellij.util.io.BaseDataReader$1.run(BaseDataReader.java:63)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Result is already set
	at com.intellij.util.concurrency.FutureResult.assertNotSet(FutureResult.java:62)
	at com.intellij.util.concurrency.FutureResult.set(FutureResult.java:37)
	at xyz.elmot.clion.openocd.OpenOcdComponent$DownloadFollower.onTextAvailable(OpenOcdComponent.java:192)
	... 20 more

Feature request: Pass user OpenOCD arguments

Right now all controll user has over OpenOCD is selecting board script

  1. Add freedom to chose more then one script (separate target and interface scripts)
  2. Change OpenOCD commands from default ;reset;shutdown to any.

AC6 System Workbench 4 STM32 has interface with many options
sw4stm32_debugger
sw4stm32_startup

Seperate symbol file from run file?

Hi, I currently have a custom project made for a NRF51. I use arm-none-eabi-objcopy to create a .hex file that gets flashed to the chip.

I got everything working fine, the plugin starts OpenOCD, flashes the .hex file and starts GDB. However it appears that you also pass the same .hex file to GDB as the symbol file.

Is it possible to select a different symbol file (.out) from the executable?

Cannot point to OpenOCD home on Ubuntu 16.04 Desktop and CLion 2017.3

Expected Behavior

User can point to OpenOCD home directory on Linux

Actual Behavior

Getting "OpenOCD Home is invalid" when pointing to OpenOCD home.
image

Directory content:

total 3292
lrwxrwxrwx 1 kamil kamil      17 gru  4 21:15 libftdi1.so -> libftdi1.so.2.2.0
lrwxrwxrwx 1 kamil kamil      17 gru  4 21:15 libftdi1.so.2 -> libftdi1.so.2.2.0
-rw-r--r-- 1 kamil kamil  150728 lis 10 12:31 libftdi1.so.2.2.0
lrwxrwxrwx 1 kamil kamil      25 gru  4 21:15 libhidapi-hidraw.so -> libhidapi-hidraw.so.0.0.0
lrwxrwxrwx 1 kamil kamil      25 gru  4 21:15 libhidapi-hidraw.so.0 -> libhidapi-hidraw.so.0.0.0
-rw-r--r-- 1 kamil kamil   26632 lis 10 12:31 libhidapi-hidraw.so.0.0.0
-rw-r--r-- 1 kamil kamil   31744 lis 10 12:31 librt-2.24.so
lrwxrwxrwx 1 kamil kamil      13 gru  4 21:15 librt.so -> librt-2.24.so
lrwxrwxrwx 1 kamil kamil      13 gru  4 21:15 librt.so.1 -> librt-2.24.so
lrwxrwxrwx 1 kamil kamil      16 gru  4 21:15 libudev.so -> libudev.so.1.6.5
lrwxrwxrwx 1 kamil kamil      16 gru  4 21:15 libudev.so.1 -> libudev.so.1.6.5
-rw-r--r-- 1 kamil kamil  131344 lis 10 12:31 libudev.so.1.6.5
lrwxrwxrwx 1 kamil kamil      19 gru  4 21:15 libusb-0.1.so -> libusb-0.1.so.4.4.4
lrwxrwxrwx 1 kamil kamil      19 gru  4 21:15 libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
-rw-r--r-- 1 kamil kamil   28872 lis 10 12:31 libusb-0.1.so.4.4.4
lrwxrwxrwx 1 kamil kamil      19 gru  4 21:15 libusb-1.0.so -> libusb-1.0.so.0.1.0
lrwxrwxrwx 1 kamil kamil      19 gru  4 21:15 libusb-1.0.so.0 -> libusb-1.0.so.0.1.0
-rw-r--r-- 1 kamil kamil  139744 lis 10 12:31 libusb-1.0.so.0.1.0
-rwxr-xr-x 1 kamil kamil 2842912 lis 10 12:31 openocd

Steps to Reproduce the Problem

  1. Create OpenOCD configuration for new project.

Specifications

  • Plugin Version: 0.8.alpha
  • CLion version: 2017.3
  • OpenOCD version: 0.10.0
  • GDB Version: n/a
  • STM32CubeMX version: n/a
  • Toolchain: n/a
  • Platform: Ubuntu 16.04 Desktop
  • Hardware configuration:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.