Posts by CheMax

    Good day, Nino!

    It's some kind of magic. Your project is working for me, while mine continues to throw an error.
    The settings are the same, with the exception of the linker. Another difference is that I have a C++ project.
    I'll do some additional research, maybe I'll find the reason.


    Regarding the libraries, everything that is needed is installed and updated to the latest versions.

    best Regards,
    Max

    Hello,

    I'm use Segger Compiler with additional option:
    -mllvm

    -segger-opt=-PreMovCCr

    These options were suggested to me by Rainer Herbertz after my compiler error message.

    There is no such problem with the GСС compiler.

    Best Regards,
    Max

    Hello,

    Today I see strange warning from "Segger" compiler (but linker is GNU, because I used nrf52840 ):

    Bash
    C:/Users/../AppData/Local/SEGGER/SEGGER Embedded Studio/v3/packages/CMSIS_5/CMSIS/Lib/ES/arm_cortex_math_v7em_fpv4_sp_d16_hard_t_le_eabi_balanced_STOP.a does not exist.

    In this directory I have any difference files:

    but among them there is not one that will have the suffix stop.

    What is causing this warning?
    Why are there so many library options when only fast, balanced, and small options are available?
    and why the required library is not generated?

    Hello, Nino!

    Thanks for your answer. While I was waiting for your answer, I did a little research on this topic.
    As I understand it, I can use my own memory allocation mechanisms (for example from FreeRTOS) and for this I just need to redefine three functions (after choose "None" in heap library option)?

    _____________________________________________
    best Regards,
    Max

    Hello, Nino!


    To answer your other questions.
    1: No. Just different documentation for different things.
    2: Same functions are used. emRun++ is a superset of emRun.

    Ok, understood.

    3: The straight forward approach is to initialize heap to some pattern e.g. 0xCDCD. Then let your worst case test run and check the usage in the memory window.
    Alternatively a watermark variable could be used, but this will have some impact on system runtime.

    I found several defines:

    but I can't find their usage, since the library is supplied in a compiled form (files heapops_xxx.a).

    I understand that these definitions are used inside the library for the memory scheduler when allocating / freeing memory sections. But their use outside the user is not available?
    and in that case i should add my mechanism?

    I roughly imagine the mechanics of the water mark (I used it in freertos), I’m ready to put up with overhead costs in runtime. But not yet imagining how they can be added to a closed library if there is no access to the current memory allocation functions.

    I could not find it on the wiki and in the documentation, do you have a garbage collector?

    _____________________________________________
    best Regards,
    Max

    Hello,
    it's me again.

    There is a section in the document "emRun User Guide & Reference manual" [UM12007, Date: November 2, 2022] for the runtime library, indicating several functions:

    Code
    __SEGGER_RTL_init_heap();
    __SEGGER_RTL_X_heap_lock();
    __SEGGER_RTL_X_heap_unlock();


    I have tried using them in my code. A search in all project files showed that these functions are marked with the attribute "weak" which means I have to define a function with the same name to use. But it doesn't work. After compilation, these functions are removed (I looked at the map file). At the same time, in the disassembler window, in the same map file, there are functions with names:

    Code
    <__heap_lock>
    <__heap_unlock>

    Which I could already use in my code like this:

    In this regard, questions:
    1. Is there an error in the function description in the documentation?
    2. When using the C++ compiler, can these functions be used or are there analogues?
    3. How can I control the amount of free heap space? I would like to know how much my application will "eat up" in the worst case scenario and if there are any memory leaks.

    thanks

    I would think that Segger would have some supported way of customizing how the mutex is implemented, so that you could integrate it into an RTOS that is not supported out-of-the-box. But I'm not using Embedded Studio so I'm not sure what that mechanism is (or even if it actually exists - I'm just speculating).

    but what You using? :)

    Hello,

    Thank you for your inquiry.

    That is correct. Same with other OS specific library functions. The standard library only defines what certain constructs should do when called. But how they operate is implementation defined by the RTOS that is being used.You can of course write your own multi tasking system, but then you also have to supply your setup specific mutex implementation.

    Best regards,
    Nino

    Hello.
    I was carried away by the project, I forgot to go to the forum. Thanks for your reply.

    The library is located in the system directory, visible in all projects. I need to make some changes to it, in particular, include header files.
    When updating a library (there is nothing better than updating something that works :) ) will my changes be erased?

    Good day ladies and gentlemen,
    I have a little question about C++ support for Embedded Studio. I trying use std::mutex, but I'm getting an error: "no type named 'mutex' in namespace 'std'".
    This is a bit surprising since the header file <mutex> exists. Judging by its contents, the creation of a mutex is not available because multithreading is not available. It's strange, because even on a single-core controller, interrupts can occur, which means that mutexes are also needed in single-threaded mode.

    Do you have plans to add mutex support?

    example code:

    Thanks,
    Best regards

    Hello,

    I find beatiful font with ligatures feature: FiraCode.
    I set this font as default for editor, But I'm not sure if the editor supports the function of replacing some characters.

    Searching the forum showed that the option is there (one, another (search result: span.s1 {font-variant-ligatures: no-common-ligatures})) , but can I use it?

    In notepad++ for support ligatures enough enabling DirectWrite, maybe You have this options too?

    best regards,
    Max

    Hello,
    Today I tried create a new simulation project for learning new features C++20, but failed.
    This project: Sandbox.7z

    So, The project consists of a main file and a class file. The class file only describes the constructor and destructor.


    If Project option -> Library -> Runtime Library i choose: Embedded Studio the build is success.
    But if I choose SEGGER, the biuld is fail with errors:

    Code
    Building ‘sandbox’ from solution ‘sandbox’ in configuration ‘Debug’
      Compiling ‘system_nrf52.c’
      Linking sandbox.elf
        undefined symbol: __cxa_atexit
        undefined symbol: __dso_handle
    Build failed

    But if you comment out the destructor, then the project is built with any library.

    What could I "break" ^^ ?

    ________________________________________________
    best regards,
    Max

    Hello, Nino

    Yes, I made those changes right away. Without them, I got a compilation error.

    But thanks for the link to the thread, I probably missed it when searching. She gave me a couple of thoughts, I want to check them. I'll supplement the answer a little later.
    _______________________________________________
    Best regards,
    Max

    Good day,

    I checked the forum for similar topics, but no answer was found. So I reopen it.

    I came across the fact that when analyzing the operation of the system, the total load is more than 100%.There are only three processes in the project: main, devices and data processing (process).

    How can you replace the load in the screenshot below is determined incorrectly. I assume that the idle time is the one miscalculated, because the data processing time coincides with my measurements (using 2methods: displayed the duration on the GPIO and using a DWT counter):

    I attach the recording file: cpu_load_over100.SVDat

    FreeRTOS version is 10.4.0.
    Patch applied manually.
    Systemview setting is standard.
    FreeROTS config: FreeRTOSConfig.zip

    _______________________________________________
    Best regards,
    Max

    Hello,
    I ran into an unpleasant moment due to which the build of my project stopped.The project was created for the STM32 microcontroller to study the use of C ++ for embedded systems.
    The corresponding packages are installed:
    stm32l4;
    CMSIS 5 (Core and DSP)

    SES Version: 5.40c

    To get access to some assembly functions (for example __NOP(), __SEV(), __WFI(), ... ) I include the file "cmsis_gcc.h" and I get the following errors:

    Code
    Building ‘stm32L4’ from solution ‘stm32L4’ in configuration ‘Debug’
      Compiling ‘main.cpp’
        main.cpp
        'const __cmsis_start()::__copy_table_t __copy_table_start__', declared using local type 'const __cmsis_start()::__copy_table_t', is used but never defined [-fpermissive]
        'const __cmsis_start()::__copy_table_t __copy_table_end__', declared using local type 'const __cmsis_start()::__copy_table_t', is used but never defined [-fpermissive]
        'const __cmsis_start()::__zero_table_t __zero_table_start__', declared using local type 'const __cmsis_start()::__zero_table_t', is used but never defined [-fpermissive]
        'const __cmsis_start()::__zero_table_t __zero_table_end__', declared using local type 'const __cmsis_start()::__zero_table_t', is used but never defined [-fpermissive]
    Build failed

    The search for a way to fix this error led to the forum: Github: ARM CMSIS. But the solution suggested there has to do with modifying the file "cmsis_gcc.h":


    I believe that it is bad form to modify the file you supplied in the package.
    I have attached a project that reproduces the given problem: stm32.zip.

    Please, tell me how to deal with this error?
    ____________________________________________
    With best regards,
    Max