Arm Mbed OS support forum

Disable CAN interrupts to go to sleep mode

Hey,
I am having trouble going into sleep mode on LPC1768 using mbed OS v5 as my CAN interrupts are always enabled. I am using the can.attach function using IRQtype as RxIrq to attach a function whenever a CAN frame received interrupt is generated(Documentation for CAN functions:
Mbed OS Reference | CAN Class Reference)
However this is preventing the controller from going into sleep mode. Is there any way to detach the CAN interrupt and go into sleep mode? Any help would be much appreciated.

Hello Vishal,

Attaching a 0 (or NULL), as explained in the func parameter description, should work as detach.

Best regards, Zoltan

I want to read output of my AT command which is sent to GSM modem using c code.I made a code but in this code buffer is not showing proper output.please help me. I want to print the cell information using this code.AT command which is I use is “AT+CCED=0,2”.

thanks
alexsunny

Hello Jacky,

How your question about GSM modem is related to this topic about sleep mode and CAN interrupts?
Better is create new topic and provide more information about your project and problem.

  • Your board
  • Mbed version
  • Mbed tool - online, CLI, MbedStudio
  • Modem type
  • A code what you achieved and where you stuck

BR, Jan

Hey Zoltan,
I am still not able to enter sleep mode. Is running a ticker preventing the controller from entering sleep mode? If so how do i implement the Low power ticker? When i add the macro “MBED_TICKLESS” as well as add the “LPTICKER” tag to “device_has”, i get an error while compiling. Could you let me know how to enable low power ticker as well as let me know if anything else prevents LPC1768 from going to sleep mode on mbed os 5.

targets.json

 "LPC1768": {
        "inherits": ["LPCTarget"],
        "core": "Cortex-M3",
        "extra_labels": ["NXP", "LPC176X", "MBED_LPC1768", "NXP_EMAC"],
        "supported_toolchains": ["ARM", "uARM", "GCC_ARM", "GCC_CR", "IAR"],
        "detect_code": ["1010"],
        "device_has": ["USTICKER", "ANALOGIN", "ANALOGOUT", "CAN", "DEBUG_AWARENESS", "EMAC", "ETHERNET", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOCALFILESYSTEM", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SEMIHOST", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES", "FLASH", "LPTICKER"],
        "macros" : ["MBED_TICKLESS"],        
        "release_versions": ["2", "5"],
        "features": ["LWIP"],
        "device_name": "LPC1768",
        "bootloader_supported": true,
        "overrides": {
            "network-default-interface-type": "ETHERNET"
        }

Linking error

 BUILD/LPC1768/GCC_ARM/mbed-os/hal/mbed_lp_ticker_api.o:(.rodata.lp_interface+0x0): undefined reference to `lp_ticker_init'

thanks my issue has been fixed.