chSysHalt("SV#8") at Vector78

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

chSysHalt("SV#8") at Vector78

Postby vrollei » Thu Jan 25, 2018 1:56 pm

Hi,

what could be a reason of chSysHalt("SV#8") inside STM32_DMA1_CH3_HANDLER (STM32F427)?
Vitaly

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: chSysHalt("SV#8") at Vector78

Postby Giovanni » Thu Jan 25, 2018 2:08 pm

Hi,

It could be something wrong done in the DMA callback or an invalid priority assigned to the DMA interrupt.

Giovanni

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: chSysHalt("SV#8") at Vector78

Postby vrollei » Thu Jan 25, 2018 2:42 pm

Hi,

how to investigate it? I have SV#8 at VectorB0 (ST TIM2) as well.
Vitaly

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: chSysHalt("SV#8") at Vector78

Postby Giovanni » Thu Jan 25, 2018 3:50 pm

Are you using a different build system / startup files / something else?

Giovanni

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: chSysHalt("SV#8") at Vector78

Postby vrollei » Thu Jan 25, 2018 4:00 pm

Just trying to run CycloneTCP.... :-)

Makefile:

# Startup files.
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk

LDSCRIPT= $(STARTUPLD)/STM32F427xI.ld
/*
* ST32F427xI memory setup.
* Note: Use of ram1, ram2 and ram3 is mutually exclusive with use of ram0.
*/
MEMORY
{
flash0 : org = 0x08000000, len = 1M
flash1 : org = 0x08100000, len = 1M
flash2 : org = 0x00000000, len = 0
flash3 : org = 0x00000000, len = 0
flash4 : org = 0x00000000, len = 0
flash5 : org = 0x00000000, len = 0
flash6 : org = 0x00000000, len = 0
flash7 : org = 0x00000000, len = 0
ram0 : org = 0x20000000, len = 192k /* SRAM1 + SRAM2 + SRAM3 */
ram1 : org = 0x20000000, len = 112k /* SRAM1 */
ram2 : org = 0x2001C000, len = 16k /* SRAM2 */
ram3 : org = 0x20020000, len = 64k /* SRAM3 */
ram4 : org = 0x10000000, len = 64k /* CCM SRAM */
ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */
ram6 : org = 0x00000000, len = 0
ram7 : org = 0x00000000, len = 0
}
Last edited by vrollei on Thu Jan 25, 2018 4:31 pm, edited 1 time in total.
Vitaly

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: chSysHalt("SV#8") at Vector78

Postby vrollei » Thu Jan 25, 2018 4:16 pm

May be this is related to this problem

viewtopic.php?f=24&t=4471
Vitaly

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: chSysHalt("SV#8") at Vector78

Postby Giovanni » Thu Jan 25, 2018 4:34 pm

Probably yes, that osCreateTask() calls I-class and S-class functions without a critical zone.

Giovanni

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: chSysHalt("SV#8") at Vector78

Postby vrollei » Thu Jan 25, 2018 4:39 pm

There is lock, I just skipped it in sample code
Vitaly

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: chSysHalt("SV#8") at Vector78

Postby vrollei » Thu Jan 25, 2018 6:09 pm

It seems that problems are related to thread created by this function:

Code: Select all

osCreateTask(const char_t *name, OsTaskCode taskCode,
   void *params, size_t stackSize, int_t priority)
{
  void *wa;
  thread_t *tp;
  stackSize *= sizeof(uint_t);
  wa = osAllocMem(THD_WORKING_AREA_SIZE(stackSize));
  chSysLock()
  thread_descriptor_t td = {name, THD_WORKING_AREA_BASE(wa), THD_WORKING_AREA_BASE(wa) + THD_WORKING_AREA_SIZE(stackSize) / sizeof (stkalign_t), priority,  (tfunc_t) taskCode, params};
  tp = chThdCreateI(&td)
  chSchRescheduleS();
  chSysUnlock();
}
Vitaly

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: chSysHalt("SV#8") at Vector78

Postby vrollei » Fri Jan 26, 2018 8:39 am

Hi,

why chSchWakeupS can fail in chDbgAssert((ch.rlist.current->prio >= ch.rlist.queue.next->prio), "priority order violation") here:

Code: Select all

thread_t *tp = chThdCreateI(&td);
chSchWakeupS(&tp, MSG_OK);


Thread has HIGHPRIO.

Is this the correct calculation of working area end address:

Code: Select all

THD_WORKING_AREA_BASE(wa) + THD_WORKING_AREA_SIZE(stackSize) / sizeof (stkalign_t)


Code: Select all

thread_descriptor_t td = {name, THD_WORKING_AREA_BASE(wa), THD_WORKING_AREA_BASE(wa) + THD_WORKING_AREA_SIZE(stackSize) / sizeof (stkalign_t), priority,  (tfunc_t) taskCode, params};
Vitaly


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 45 guests