Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

CC3200: driverlib from rom

Hi Cesanta,

I'm trying to use "driverlib/timer.h" functions from ROM. I see the build already defines TARGET_IS_CC3200, and I follow the instructions from swru369c.pdf (Programmer's Guide), section "6.2 CC3200 Peripheral Driver Library Services in ROM".

However, I'm still getting a linker error:

lcd_task.cpp:(.text._Z8pwm_initv+0x14): undefined reference toTimerConfigure'`

So how can we use driverlib from ROM? If that's not possible, can we add files to DRIVER_SRCS?

Thanks!

Comments

  • rojerrojer Dublin, Ireland

    this means that it is not coming from ROM.
    to use functions from ROM when possible you prefix driverlib function names with MAP_, hence it should be MAP_TimerConfigure

  • xxcnxxcn Sofia

    Right, it does have the MAP_ prefix in code, but apparently expands to the name of the function, not the ROM_ variant. Just to make sure all is good, I did this at the top:

    #define TARGET_IS_CC3200 1
    extern "C" {
        #include "rom.h"
        #include "rom_map.h"
    }
    

    Still the same weird error. Trying to use ROM_TimerConfigure fails with 'ROM_TimerConfigure' was not declared in this scope

  • xxcnxxcn Sofia

    Okay, the problem is that this function is undef-d in rom_patch.h, as well as a number of others. How do we solve this? Copying the implementations over is one way, or DRIVER_SRCS could be extendable?

  • rojerrojer Dublin, Ireland

    ok, i get it. so the function in ROM is actually buggy and they ship a replacement in the SDK.

    so, in https://github.com/cesanta/mongoose-iot/commit/4a13df4496c1d64cf11c3c1d6af047ddb9910154 i added APP_EXTRA_SRCS, which gets added to the list of all other sources.
    since driverlib is already in VPATH, you should be able to just set APP_EXTRA_SRCS = timer.c and that should be enough.

  • xxcnxxcn Sofia

    Thanks! A colleague came up with the idea of symlinking the SDK sources into our app directory, which is also a neat workaround.

  • SergeySergey Dublin, Ireland

    Yeah, symlinking should work nicely.

Sign In or Register to comment.