Page 1 of 3

chSysHalt("SV#8") at Vector78

Posted: Thu Jan 25, 2018 1:56 pm
by vrollei
Hi,

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

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

Posted: Thu Jan 25, 2018 2:08 pm
by Giovanni
Hi,

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

Giovanni

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

Posted: Thu Jan 25, 2018 2:42 pm
by vrollei
Hi,

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

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

Posted: Thu Jan 25, 2018 3:50 pm
by Giovanni
Are you using a different build system / startup files / something else?

Giovanni

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

Posted: Thu Jan 25, 2018 4:00 pm
by vrollei
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
}

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

Posted: Thu Jan 25, 2018 4:16 pm
by vrollei
May be this is related to this problem

viewtopic.php?f=24&t=4471

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

Posted: Thu Jan 25, 2018 4:34 pm
by Giovanni
Probably yes, that osCreateTask() calls I-class and S-class functions without a critical zone.

Giovanni

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

Posted: Thu Jan 25, 2018 4:39 pm
by vrollei
There is lock, I just skipped it in sample code

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

Posted: Thu Jan 25, 2018 6:09 pm
by vrollei
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();
}

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

Posted: Fri Jan 26, 2018 8:39 am
by vrollei
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};