[SOLVED] macro passed 1 arguments, but takes just 0

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] macro passed 1 arguments, but takes just 0

    I have tried using SystemView in a FreeRTOS application:

    Processor: Cortex-M3 (in LPCXpresso LPC1769 board)
    IDE: MCUXpresso IDE v11.2.1 [Build 4149] [2020-10-07]

    OS: FreeRTOS kernel v10.4.3
    SystemView: v3.20

    I have followed the steps detailed in the user guide, namely:

    • I have copied the following files into the project (keeping the recommended directory structure):
      • /Config/Global.h
      • /Config/SEGGER_RTT_Conf.h
      • /Config/SEGGER_SYSVIEW_Conf.h
      • /Config/SEGGER_SYSVIEW_Config_FreeRTOS.c
      • /Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c
      • /Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.h
      • /SEGGER/SEGGER_RTT.c
      • /SEGGER/SEGGER_RTT.h
      • /SEGGER/SEGGER_SYSVIEW_ConfDefaults.h
      • /SEGGER/SEGGER_SYSVIEW_Int.h
      • /SEGGER/SEGGER_SYSVIEW.c
      • /SEGGER/SEGGER_SYSVIEW.h
      • /SEGGER/SEGGER.h
    • I have included in the path the three folders.
    • In FreeRTOSConfig.h I define INCLUDE_xTaskGetIdleTaskHandle and INCLUDE_pxTaskGetStackStart as 1.
    • At the end of FreeRTOSConfig.h (after all the defines) I #include "SEGGER_SYSVIEW_FreeRTOS.h".
    • I have added a call to SEGGER_SYSVIEW_Conf() in the main function (after target initialization and before any FreeRTOS API function call).
    • I have not been able to apply the patch file to the FreeRTOS kernel sources because they do not match.
    When I try to compile the project it gives me the following error: macro "traceTASK_NOTIFY_FROM_ISR" passed 1 arguments, but takes just 0. It gives me the same error with the following macros:
    • traceTASK_NOTIFY_FROM_ISR
    • traceTASK_NOTIFY_GIVE_FROM_ISR
    • traceTASK_NOTIFY_TAKE
    • traceTASK_NOTIFY_WAIT
    • traceTASK_NOTIFY
    I can see, in effect, that the macro traceTASK_NOTIFY_FROM_ISR, for example, is defined as follows in the SEGGER_SYSVIEW_FreeRTOS.h file.:
    #define traceTASK_NOTIFY_FROM_ISR() SEGGER_SYSVIEW_RecordU32x5(apiID_OFFSET + apiID_XTASKGENERICNOTIFYFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue, (U32)pxHigherPriorityTaskWoken)

    However, in the tasks.c file it is called as traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify ). That is, they are defined without parameters, but they are called with a parameter.

    But no one else seems to have that problem. I miss something ...


    Did I forget to configure something?


    Thank you.
  • Hello,

    Thank you for your inquiry.
    See here for a similar problem:
    SystemView hanging (blocked call) when recording events outside of RTOS tasks.

    Essentially FreeRTOS did not stay backwards compatible to V10.0.0 so all versions after that required additional instrumentation steps.
    Some versions are already covered by our community in our forum, but I do not think I have seen someone posting his V10.4.3 config yet.

    As mentioned in the other thread. Long term we will try to provide as many patch files and samples for different FreeRTOS version as possible, but we have no timeframe for that yet.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • So that was the little detail that I forgot ... I had understood it right backwards when reading the other threads: I believed that as of FreeRTOS v10.0.0 the patch was no longer necessary.


    Well, I have tried again to create a FreeRTOS SystemView application, this time with version 10.0.0, thinking that it would not have compilation problems, but I was wrong. I have followed the steps above and also applied the patch without problems. When compiling the project I received errors such as "undefined reference to 'SEGGER_RTT_ASM_WriteSkipNoLock' " that were fixed by adding the SEGGER_RTT_ASM_ARMv7M.S file. But then I got the error "fatal error: SEGGER_RTT_Conf.h: No such file or directory" which I have not been able to fix.


    The SEGGER_RTT_Conf.h file is in the 'Config' directory, as recommended in the SystemView user guide, directory added to the path. Why am I getting that error?


    Thanks for your time, Nino. Maybe I better open another thread?
    Asier
  • Hi Asier,


    astazu wrote:

    The SEGGER_RTT_Conf.h file is in the 'Config' directory, as recommended in the SystemView user guide, directory added to the path. Why am I getting that error?
    According to the error the file could not be found, so the include path is most likely not set up right in the IDE.
    Please understand that we can't provide support for how to set up projects in third party IDEs.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Nino,

    Thanks for your time. Obviously, I understand that you cannot provide support for third party software. I also understand that the level of forum users is usually very diverse (from beginners to experts in the world of embedded software), which makes support even more difficult (for example, you cannot know if the user knows, indeed, to add a file to path).

    But I think that sometimes you hide behind third-party software: if I post the question to the MCUXpresso forum, they will tell me that they cannot offer support for FreeRTOS or SystemView, as they are third-party software. Ditto on the FreeRTOS forum. Etc.

    If I posted the question to the SystemView forum it is because it is new to my project. I've been working with MCUXpresso for years (since it was LPCXpresso) and months browsing with FreeRTOS. I'm not going to say that I have no problems with them, but so far I get the projects to compile - another thing is that they do what they should do ;)

    Now I try to add the SystemView functionality to them and that is when it stops compiling. So I think it is a SystemView problem. As specified in my previous post, the 'Config' directory was included in the path. If I look in the project properties, the 'Config' directory appears in the 'Include paths (-I)' and, in addition, it is recognizing other header files from the same directory.

    I bought the J-Link to be able to debug FreeRTOS projects in MCUXpresso (because you tell me I can do it). I get the product and follow the instructions you give (because I also understand that some users ask without even reading the user manual). But following the instructions that you give (I think, that is why I detailed the steps taken so much, because another option is that I had not followed the instructions well) I cannot reach the objective. And when I ask for help, you hide behind third-party software.

    Without further ado, Nino, I simply wanted you to understand how users feel sometimes. I have bought a product from you, I have followed your instructions, but I have not obtained any results.

    As for the problem in the previous post, I have done a little test and post it in case it could help someone. Instead of creating the directory tree recommended in the SystemView User Guide I have created the following scheme: within the 'systenview' directory I have only created two directories, one named 'src' where I have copied the source files and the other named 'inc' where I have copied the header files and the assembler file 'SEGGER_RTT_ASM_ARMv7M.S '. Obviously, I have included the file 'inc' to the path.

    Maybe it is not ideal, because the configuration files and those that are not are mixed, but it works. At least it compiles (I haven't had time to test it). I don't know why that happens (that is, I don't know what the problem is), but what I said: with the structure recommended in the user guide (structure that I detail in the first post) the project does not compile me, and with this new structure yes. The two projects are identical except for the 'systemview' directory structure (and the path, of course).

    Thank you very much,

    Asier
  • astazu,
    If compiler recognizes other header files from your Config directory, then it might be something wrong with the SEGGER_RTT_Conf.h itself. You first step is to help the compiler to see this file. Backup the original and create new one with exactly the same name and with following content:

    C Source Code

    1. #ifndef _SEGGER_RTT_CONF_H_
    2. #define _SEGGER_RTT_CONF_H_
    3. #error file_exists!
    4. #endif
    If during the compilation you will see error file_exists! then this very first simple step is accomplished.
  • Hi warlord,

    Thanks for your answer. Keeping the directory structure recommended in the SystemView user guide (detailed in the first post of this thread) and replacing the SEGGER_RTT_Conf.h file as recommended, I get the error:

    Source Code

    1. C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Config/SEGGER_RTT_Conf.h:60:2: error: #error file_exists!
    2. 60 | #error file_exists!
    3. | ^~~~~
    I hope it helps. Thank you very much for your attention,
    Asier
  • Hi, Asier!
    Great, the compiler does see the file! Now open original backed up SEGGER_RTT_Conf.h file with any editor, select all, copy and paste into that modified file, replacing its content. Try to compile now.
  • Hi warlord,

    Done: I replace the content of the file with the original (copying and pasting the content, without replacing the file) and I get the original result (error in 16~18 lines):

    Source Code

    1. 11:30:08 **** Incremental Build of configuration Debug for project systemview_eredua ****
    2. make -r -j4 all
    3. Building file: ../systemview/SEGGER/SEGGER_RTT.c
    4. Building file: ../systemview/SEGGER/SEGGER_RTT_ASM_ARMv7M.S
    5. Building file: ../systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c
    6. Building file: ../systemview/SEGGER/SEGGER_SYSVIEW.c
    7. Invoking: MCU C Compiler
    8. Invoking: MCU C Compiler
    9. arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__USE_LPCOPEN -DNO_BOARD_LIB -D__LPC17XX__ -D__REDLIB__ -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\lpc_chip_175x_6x\inc" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\proiektua\inc" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\freertos\org\Source\include" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\freertos\org\Source\portable\GCC\ARM_CM3" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Config" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Sample\FreeRTOSV10" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\SEGGER" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../systemview/SEGGER/"=. -mcpu=cortex-m3 -mthumb -fstack-usage -specs=redlib.specs -MMD -MP -MF"systemview/SEGGER/SEGGER_RTT.d" -MT"systemview/SEGGER/SEGGER_RTT.o" -MT"systemview/SEGGER/SEGGER_RTT.d" -o "systemview/SEGGER/SEGGER_RTT.o" "../systemview/SEGGER/SEGGER_RTT.c"
    10. Invoking: MCU Assembler
    11. Invoking: MCU C Compiler
    12. arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__USE_LPCOPEN -DNO_BOARD_LIB -D__LPC17XX__ -D__REDLIB__ -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\lpc_chip_175x_6x\inc" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\proiektua\inc" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\freertos\org\Source\include" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\freertos\org\Source\portable\GCC\ARM_CM3" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Config" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Sample\FreeRTOSV10" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\SEGGER" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../systemview/Sample/FreeRTOSV10/"=. -mcpu=cortex-m3 -mthumb -fstack-usage -specs=redlib.specs -MMD -MP -MF"systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.d" -MT"systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.o" -MT"systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.d" -o "systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.o" "../systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c"
    13. arm-none-eabi-gcc -c -x assembler-with-cpp -DDEBUG -D__CODE_RED -DCORE_M3 -D__USE_LPCOPEN -DNO_BOARD_LIB -D__LPC17XX__ -D__REDLIB__ -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\lpc_chip_175x_6x\inc" -g3 -mcpu=cortex-m3 -mthumb -specs=redlib.specs -o "systemview/SEGGER/SEGGER_RTT_ASM_ARMv7M.o" "../systemview/SEGGER/SEGGER_RTT_ASM_ARMv7M.S"
    14. arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__USE_LPCOPEN -DNO_BOARD_LIB -D__LPC17XX__ -D__REDLIB__ -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\lpc_chip_175x_6x\inc" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\proiektua\inc" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\freertos\org\Source\include" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\freertos\org\Source\portable\GCC\ARM_CM3" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Config" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Sample\FreeRTOSV10" -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\SEGGER" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../systemview/SEGGER/"=. -mcpu=cortex-m3 -mthumb -fstack-usage -specs=redlib.specs -MMD -MP -MF"systemview/SEGGER/SEGGER_SYSVIEW.d" -MT"systemview/SEGGER/SEGGER_SYSVIEW.o" -MT"systemview/SEGGER/SEGGER_SYSVIEW.d" -o "systemview/SEGGER/SEGGER_SYSVIEW.o" "../systemview/SEGGER/SEGGER_SYSVIEW.c"
    15. In file included from ../systemview/SEGGER/SEGGER_RTT_ASM_ARMv7M.S:18:
    16. ../systemview/SEGGER/SEGGER_RTT.h:60:10: fatal error: SEGGER_RTT_Conf.h: No such file or directory
    17. 60 | #include "SEGGER_RTT_Conf.h"
    18. | ^~~~~~~~~~~~~~~~~~~
    19. compilation terminated.
    20. make: *** [systemview/SEGGER/subdir.mk:34: systemview/SEGGER/SEGGER_RTT_ASM_ARMv7M.o] Error 1
    21. make: *** Waiting for unfinished jobs....
    22. Finished building: ../systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c
    23. Finished building: ../systemview/SEGGER/SEGGER_SYSVIEW.c
    24. Finished building: ../systemview/SEGGER/SEGGER_RTT.c
    25. "make -r -j4 all" terminated with exit code 2. Build might be incomplete.
    26. 11:30:17 Build Failed. 3 errors, 0 warnings. (took 8s.454ms)
    Display All
  • Asier,
    First thing that you should pay your attention for is the file that is being compiled and raised the error:
    ../systemview/SEGGER/SEGGER_RTT_ASM_ARMv7M.S
    This is the assembly one, not C.

    Second, if we look to the compilers arguments, in particular, what include directories have been supplied:

    C files:
    -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\lpc_chip_175x_6x\inc"
    -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\proiektua\inc"
    -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\freertos\org\Source\include"
    -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\freertos\org\Source\portable\GCC\ARM_CM3"
    -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Config"
    -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\Sample\FreeRTOSV10"
    -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\systemview_eredua\systemview\SEGGER"

    ASM:
    -I"C:\Axi\proiektua_2019\gral\workspaces\freertos\lpc_chip_175x_6x\inc"

    As your can see, lists are quite different, and what is worst, there is no Config directory in ASM list.

    Third, you should now look again through the Compiler and, possibly, Assembler settings and find the answer.
  • Hi warlord,

    Great! Every day you learn something ... and with help much more.

    First: I thought the error came from SEGGER_RTT.h: 60: 10, but no, I realize that a line before marks the error that you point out to me, SEGGER_RTT_ASM_ARMv7M.S: 18:

    Second: I had no idea that assembler files had their own path.

    Third: now I understand why the src and inc directory structure worked. The inc directory was in the path of the assembler files.

    I have included the Config directory in the path of the assembly files and... voilá! Compile perfectly.

    In the end, it was my mistake and it was, indeed, the path, as Nino pointed out. But I would like to emphasize that with a little help, the less experienced can also learn and enjoy these devices. Think, if not, in what position I was: I had bought a J-Link to debug FreeRTOS projects and it was of no use to me.

    Although it is not true, it has not been a little help, it has been A LOT of help. Thank you very, very much for your time, patience and dedication, warlord. With help like the one you have offered me, you can learn a lot. Thank you very much, really.

    Asier