Exception occurred (up_assert: Assertion failed at file: semaphore/sem_post.c)

Asked 2 years ago, Updated 2 years ago, 42 views

This is a double post with the SPRESENSE group on Facebook (-) (_) Pecory

The main sketch of rsp_sample.ino was replaced with mock_ili9341.ino, a sample sketch of the Adafruit GFX Library.
The first various patterns are drawn without any problems, but the following exceptions occur repeatedly during the last loop() process:
(Occurs after the 38th loop()
You seem to be failing to acquire some semaphore, but
·What are the exceptions?
·Are there any measures to eliminate the occurrence of exceptions?

Hardware Configuration: SPRESENSE Mainboard + CXD5602 PWBEXT1 + 2.8" Adafruit TFT shield (ILI9341 SPI)
Running Serial Console View

ILI9341 Test!
Display Power Mode: 0xCA
MADCTL Mode—0xA4
Pixel Format: 0x82
Image Format: 0xC0
Self Diagnostic: 0x80
Benchmark Time (microseconds)
Screen fill 160184
Text93901
Lines 1018494
Horiz/Vert Lines 20293
Rectangles (outline) 15838
Rectangles (filed) 335584
Circles (filed) 255061
Circles (outline) 446452
Triangles (outline) 218124
Triangles (filed) 234086
Rounded rects (outline) 141263
Rounded rects (filed) 446006
Done!
up_assert:Assertion failed at file:semaphore/sem_post.line:118 task:init
up_dumpstate:sp:0d04cc0c
up_dumpstate —IRQ stack:
up_dumpstate:base:0d044600
up_dumpstate:size:00000800
up_dumpstate:used:000000f8
up_dumpstate —User stack:
up_dumpstate:base:0d04ccb8
up_dumpstate:size:00001fec
up_dumpstate:used:000002b8
up_stackdump:0d04cc00:0000007c0000009800000001000000001400000000000000d007fb70d03f4c80d011d09
up_stackdump:0d04cc20:0d042a400d004e2d0d0429c40d00185f000007e000007e00000001805
up_stackdump:0d04cc40:0d0382d20d0429c400d0382bd0d005759000f42400d0429c40d0429c40d0d00000000
up_stackdump:0d04cc60:0d03cb680d005795000f42400d0429c40c2955290d002e710000000000000001
up_stackdump:0d04cc80:0d0426900d002ee70d053a980d03cb7c0d03cb7c0d0053c90d01fcdf00000101
up_stackdump:0d04cca 0:00000000000000000000000000d008763 000000000000000000 deadbeef0d04cc4
up_taskdump:Idle Task:PID=0 Stack Used=0 of 0
up_taskdump:hpwork:PID=1 Stack Used=584 of 2028
up_taskdump:lpwork:PID=2Stack Used=352 of 2028
up_taskdump:lpwork:PID=3Stack Used=352 of 2028
up_taskdump:lpwork:PID=4Stack Used=352 of 2028
up_taskdump:init:PID=5 Stack Used=696 of 8172
up_taskdump:cxd56_pm_task:PID=6 Stack Used=320 of 996
up_taskdump:<pthread> —PID=7Stack Used=312 of 1020

Thank you for your cooperation.

spresense

2022-09-30 10:31

2 Answers

up_assert:Assertion failed at file:semaphore/sem_post.line:118 task:init

Since you see the message, check the contents of the assert statement on line 118 of the file semaphore/sem_post.c.

Also, if you investigate the reason why Assertion did not work, you will find a clue to solving the problem.


2022-09-30 10:31

I am in charge of SPRESENSE support for Sony.
We have investigated your inquiry.

The problem was caused by hand-on LCD libraries.

Lines 134-143 of "Adafruit_SPITFT_Macros.h" in the distributed file, write the following:

#if defined (ARDUINO_ARCH_SPRESENSE)
    # undef HSPI_BEGIN_TRANSACTION
    # define HSPI_BEGIN_TRANSACTION() HSPI_SET_CLOCK(); SPI_OBJECT.setBitOrder(MSBFIRST); SPI_OBJECT.setDataMode(SPI_MODE3)

    # undef SPI_BEGIN
    #define SPI_BEGIN() if(_sclk<0) {SPI_OBJECT.begin();HSPI_BEGIN_TRANSACTION();}

    # undef SPI_BEGIN_TRANSACTION
    #define SPI_BEGIN_TRANSACTION()
#endif

Add two lines as follows:

#if defined (ARDUINO_ARCH_SPRESENSE)
    # undef HSPI_BEGIN_TRANSACTION
    # define HSPI_BEGIN_TRANSACTION() HSPI_SET_CLOCK(); SPI_OBJECT.setBitOrder(MSBFIRST); SPI_OBJECT.setDataMode(SPI_MODE3)

    # undef SPI_BEGIN
    #define SPI_BEGIN() if(_sclk<0) {SPI_OBJECT.begin();HSPI_BEGIN_TRANSACTION();}

    # undef SPI_BEGIN_TRANSACTION
    #define SPI_BEGIN_TRANSACTION()

    # undef SPI_END_TRANSACTION
    #define SPI_END_TRANSACTION()
#endif

This will solve the problem.
Thank you for your report.

Thank you for your continued support for the Presense.


2022-09-30 10:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.