Posts by Kenny

    Commenting and uncommenting code is likely to confuse the issue when you have something like a hard fault. I'm actually battling one myself right now on an STM32F415. The system control block has some registers that you can inspect that can be helpful. Check your stacks for overflow if you are using an RTOS (the plugins for EMBOS and FreeRTOS will display this information). You can find hard fault handler code out there that will pull useful information off the stack.

    The real tool to use for this is trace. Unfortunately the STM32F parts do not have an ETB (on board trace buffer that can be read by the debugger). Instead you need to run the trace lines to your debug connector and purchase something like a J-Trace. I am in the process of ordering one myself for an STM32F7 project.

    Good luck.

    This somehow fixed itself. Can now connect but I'm not getting any data. I do have SWO run to pin 6 of the so-called 9-pin connector. I simply enabled SWO as a trace option and tried some things with the trace window open in the debugger.

    When attempting to use trace with SWO I get a dialog "connect failed". The last line in the output window is: Executing script EnableTrace("SWO"). My target is an STM32F415. SES 3.10e.

    Best regards,

    Kenny

    I've defined a single directory for my compiler output (*.d, *.o, *.elf, *.map etc). Over time I see a large number of files whose names begin with 'tmp'. Is this a bug? Can it be disabled?

    Silverback: ls tmp*

    tmpT2z7aY tmpgRuLoX tmptffH8U tmpyFE8nZ

    They seem to contain assembler output:


    .syntax unified
    .cpu cortex-m7
    .eabi_attribute 28, 1
    .fpu fpv5-d16
    .eabi_attribute 20, 1
    .eabi_attribute 21, 1
    .eabi_attribute 23, 3
    .eabi_attribute 24, 1
    .eabi_attribute 25, 1
    .eabi_attribute 26, 1
    .eabi_attribute 30, 1
    .eabi_attribute 34, 1
    .eabi_attribute 18, 4
    .thumb
    .syntax unified
    .file "ethernetif.c"
    .text
    .Ltext0:
    .section .text.low_level_input,"ax",%progbits
    .align 2
    .thumb
    .thumb_func
    .type low_level_input, %function
    low_level_input:
    .LFB144:
    .file 1 "/Volumes/Project/micromodulator/LWIP/Port/ethernetif.c"
    .loc 1 279 0
    @ args = 0, pretend = 0, frame = 0
    @ frame_needed = 0, uses_anonymous_args = 0
    .LVL0:
    push {r4, r5, r6, r7, r8, r9, r10, lr}
    .LCFI0:
    .LVL1:

    My imported ST Cube project is complaining:

    Quote


    #ifndef __ARMVFP__
    #error This port can only be used when the project options are configured to enable hardware floating point support.
    #endif

    I've selected hard floating point and the correct architecture in `Code Generation` (see attached). I can hack this and try to define this macro but what is the proper way to get this work. I have another (non-Cube) based project that does not use the ST HAL for this same processor with FreeRTOS integrated and do not have this error but I cannot find the difference between the two.

    Thanks.

    I used the latest ST CubeMX to write an EMARM project and then tried to import it into SES. I selected internal toolchain only. So far I'm seeing two problems. The first is that nearly all the source files are flagged 'exclude from project'. The second is that the include files cannot be found. The project settings use the definition below. I have changed them to be prefixed with$(ProjectDir) which seems to work.

    Also a feature request: I have to now tell SES to include all the source files. If I click on a directory and uncheck 'exclude from project' the individual files are still excluded. I have pick each file one-by-one. Is it possible to select multiple? I tried a few things and couldn't get it to go.

    It also seems that copying and pasting from SES in to this forum doesn't get the line endings quite right :)


    Code
    ./../Inc./../Middlewares/Third_Party/LwIP/src/include./../Middlewares/Third_Party/LwIP/system./../Drivers/STM32F7xx_HAL_Driver/Inc./../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy./../Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM7/r0p1./../Middlewares/Third_Party/FreeRTOS/Source/include./../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS./../Middlewares/Third_Party/LwIP/src/include/lwip./../Middlewares/Third_Party/LwIP/src/include/lwip/apps./../Middlewares/Third_Party/LwIP/src/include/lwip/priv./../Middlewares/Third_Party/LwIP/src/include/netif./../Middlewares/Third_Party/LwIP/src/include/netif/ppp./../Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl./../Middlewares/Third_Party/LwIP/src/include/posix./../Middlewares/Third_Party/LwIP/src/include/posix/sys./../Middlewares/Third_Party/LwIP/system/arch./../Drivers/CMSIS/Include./../Drivers/CMSIS/Device/ST/STM32F7xx/Include

    I haven't used this processor but I have some experience customizing SES. Here are a few things to look out for:

    You'll need to define a memory map and section placement file for your device. SES uses .xml files for this. They are pretty easy to edit and you can start with one for another processor. A nice feature of SES is that when you right-click a project to edit you can type in a partial search phrase. So searching for "map" of "placment" will narrow down the properties so you can see which are required to tell SES where these files are located.

    If the manufacturer supports CMSIS you can copy those files to your project. Or just copy the headers provided. I do this even though my processor is supported by an SES package because I want to capture my exact build in my version control system. Use the search feature to find "includes" to add these search files.

    For the debugger you'll want a register definition file. There are two formats: .xml and .svd. The latter is a CMSIS thing and your manufacture may have provided these. It's not difficult to create your own if you start from an existing file. Search for "register" to find this in the project options.

    I believe the default project will give you a crt0.s, vectors.s, and a startup.s that you can tweak to get you to main. I typically define SystemInit to bring up my GPIO and clocks before the C run-time initialization and main() are called.

    The basic boot process (for those who may not have been through this):

    • vectors.s defines the initial stack pointer and Reset_Handler as the first two vectors.
    • Reset_Handler is defined in startup.s. You can configure this a bit but it will call SystemInit() which is normally defined in the system.c but you can define your own. There are other optional things (like copying vectors to RAM) but eventually it calls _start.
    • _start is defined in crt0.s. It will initialize the C run-time environment (things like initializing variables) and call main().


    SES will give you a good starting point but you need to make sure all these pieces go together correctly which can be a little work.

    I have used IAR, Keil, and Eclipse in anger (as my friend would say) and I have found SES to be a preferable solution. It does sometimes give me fits but not as much as the others. YMMV.

    Try "File->New Project..." then choose "An externally built executable...".

    Choose the correct processor and an .elf file.

    After the project is built you can start a debug session.

    I did have some problems resolving search paths for source files. Try adding directories using:

    Debug->Options->Search Paths...

    I tried to use and could not. The user manual shows a list of ported template headers and it is not included. The latest GCC "Launchpad" does include this and GCC 5.x fully implements C++14 which is what I would like to do.

    Earlier on this forum I asked how I could point to other tools and was told I could do this by setting a single options setting but it seems that it is not this simple. The SES directory structure has as, cc1, and cc1plus etc in a single directory while the ARM directory has things scattered about:

    Code
    ./arm-none-eabi/bin/as
    ./bin/arm-none-eabi-as
    ./bin/arm-none-eabi-g++
    ./bin/arm-none-eabi-gcc
    ./lib/gcc/arm-none-eabi/5.4.1/cc1plus
    ./lib/gcc/arm-none-eabi/5.4.1/cc1

    Any advice as to how to point to these tools? I was hoping to leave the Launchpad structure intact. I may try to hack it with some symbolic links but I'm hoping this isn't necessary.

    Update:

    I created symbolic links to cc1 and cc1plus in GCC_LAUNCHPAD_ROOT/arm-none-eabi/bin. Then I set my toolchain directory to this value.

    I tried two versions:

    gcc-arm-none-eabi-4_9-2015q1

    gcc-arm-none-eabi-5_4-2016q2


    The first appears to build and run correctly. I can see the path to these files use for as, cc1, cc1plus.


    The second fails with:

    Code
    1> Output/Hail.o: In function `Hail::~Hail()':
    1> /Volumes/Development/louise/Application/Hail.cpp:263: undefined reference to `operator delete(void*, unsigned int)'
    1> Output/Hail.o: In function `Hail::~Hail()':
    1> /Volumes/Development/louise/Application/Hail.cpp:263: undefined reference to `operator delete(void*, unsigned int)'
    1> Output/DMA.o: In function `DMA::Object::~Object()':
    1> /Volumes/Development/louise/ST/DMA.cpp:102: undefined reference to `operator delete(void*, unsigned int)'

    I suspect library incompatibility:

    Code
    "/Applications/SEGGER Embedded Studio 2.20/lib/libdebugio_mempoll_v7em_fpv4_sp_d16_t_le_eabi.a" "/Applications/SEGGER Embedded Studio 2.20/lib/libm_v7em_fpv4_sp_d16_t_le_eabi.a""/Applications/SEGGER Embedded Studio 2.20/lib/libc_v7em_fpv4_sp_d16_t_le_eabi.a""/Applications/SEGGER Embedded Studio 2.20/lib/libcpp_v7em_fpv4_sp_d16_t_le_eabi.a""/Applications/SEGGER Embedded Studio 2.20/lib/libdebugio_v7em_fpv4_sp_d16_t_le_eabi.a""/Applications/SEGGER Embedded Studio 2.20/lib/libvfprintf_v7em_fpv4_sp_d16_t_le_eabi.o""/Applications/SEGGER Embedded Studio 2.20/lib/libvfscanf_v7em_fpv4_sp_d16_t_le_eabi.o"

    What is the recommended way to point to the correct libraries?

    Yes: A.o depends on A.cpp which depends on A.py.

    In one IDE I have used, they optionally included a Makefile if it existed. This allowed one to build additional dependencies and rules.

    It's not so much that the IDE needs to build it as the build system needs to recognize the dependency and the rule to build it.

    Thanks,

    Kenny

    I have a Python script that generates some C++ code. What is the best way to add a dependency on the C++ so that if the Python is newer the C++ will be generated during a build? My preference might to maintain a makefile that is included somewhere.

    Thanks,

    Kenny

    When I run my code (not halting or stepping) for just a few minutes with the debugger attached the CPU utilization hovers around 21-22%. I have a new MacBook Pro 15 with 2.5GHz i7s.

    Can this be improved? The fan winds up to near full speed and it's a bit loud. It acts as if it polling something without letting the thread sleep but I don't want to speculate too much on your implementation.

    Thanks,

    Kenny

    Hi Til,

    Yes. That was a linker error that I posted.

    I don't have any code related to EMBOS View in my RTOS integration code only the definition of this variable. Currently I have just set it to zero.

    I have the object-code license. In this case is this the best I can do? It seems that the library wants that defined.