Error compiling Teensy4 cores

Status
Not open for further replies.

Alecter

New member
Hello everyone,
Currently Im using teensy3 to distribute firmware that uses a third party SDK. The program is written in C and to compile it I use Scons adding the links to core teensy3.
Now, we want to migrate to teensy4, but when I try to compile the cores, compiler shows this error:

Code:
/opt/arduino/hardware/teensy/avr/cores/teensy4/startup.c:770: undefined reference to `pendablesrvreq_isr'
/opt/arduino/hardware/teensy/avr/cores/teensy4/startup.c:770: undefined reference to `systick_isr'
collect2: error: ld returned 1 exit status

This is the Scons script
Code:
    env.Append(CPPPATH=[env['TEENSY4']])
    env.Append(CPPDEFINES=['__IMXRT1062__', 'ARDUINO_TEENSY_MICROMOD', 'USB_SERIAL', 'LAYOUT_US_ENGLISH'])
    env.Append(CPPDEFINES={'F_CPU' : 600000000})
    env.Append(CFLAGS=['-mcpu=cortex-m7',
                       '-mthumb',
		       '-mfloat-abi=hard',
                       '-mfpu=fpv5-d16',
                       '-ffunction-sections',
                       '-fdata-sections',
                       '-nostdlib', '-Wall','-g', '-O2'])
    env.Append(LINKFLAGS=['-mcpu=cortex-m7',
                          '-mfloat-abi=hard',
                          '-mfpu=fpv5-d16',
                          '-mthumb',
                          '-Wl,--gc-sections',
                          '-T' + os.path.join(env['TEENSY4'], 'imxrt1062.ld')])

    variant_top_dir = env['VARIANT_TOP_DIR']
    env.Append(LIBPATH=[variant_top_dir.Dir(env['RUNTIME_DIR'])])

And these are the source files that I adding to build
Code:
teensy_sources = [
        'startup.c',
	'bootdata.c',
	'digital.c',
	'analog.c',
        'nonstd.c',
        'pwm.c',
        'rtc.c',
        'delay.c',
	'clockspeed.c',
	'tempmon.c',
        'usb.c',
        'usb_serial.c',
        'usb_serial2.c',
        'usb_serial3.c',
        'usb_desc.c',
        'usb_midi.c',
        'usb_mouse.c',
        'usb_touch.c',
        'usb_joystick.c',
        'keylayouts.c',
        'usb_keyboard.c',
        'usb_rawhid.c',
        'usb_mtp.c',
        'usb_seremu.c',
        'debugprintf.c']

Can anybody help me figure out what's wrong in my script? I'll gladly take any advice or idea or how to troubleshoot this. Thanks for your time.
 
Sorry I know nothing abot scones or the like, so not sure how much help I will be...
But one thing stands out is: ARDUINO_TEENSY_MICROMOD
That is for a non-existent board that is rummer to be coming. You might want to set that instead to : ARDUINO_TEENSY40

Also grep is your friend:

systick_isr is in the file EventResponder.cpp
And I believe the other one is as well...
 
Hello KurtE,
Thanks for your answer, I will try and tell you how it goes.

On the other hand, about EventResponder, I read that I must first compile this class and then link it to the source files in C. But I don't know how to do that.
So, th problem is that for Teensy3, all source files are in C but for Teensy4 the source files has C and C++ files.
 
Status
Not open for further replies.
Back
Top