This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ERROR :stopped by vector catch

hello,

void HT1632_5X21_init(uint8_t aneDevices, uint8_t twoDevices)
{

    uint8_t i;
    numXDevices = aneDevices;
    aneMax = 32 * numXDevices-1;
    numYDevices = twoDevices;
    twoMax = 8 * numYDevices-1;
 
    numDevices = numXDevices * numYDevices;

    static uint8_t      m_tx_buf[10] = {HT1632_ID_CMD,HT1632_CMD_SYSDIS,HT1632_CMD_COMS10,HT1632_CMD_MSTMD,HT1632_CMD_SYSON,HT1632_CMD_LEDON,HT1632_CMD_PWM | 0x0c,0,1}; /**< TX buffer. */
    static const uint8_t m_length = sizeof(m_tx_buf);
    static uint8_t       m_rx_buf[11];    /**< RX buffer. */
    //memset(m_rx_buf, 0, m_length);
    APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length));
  
    cursorX = 0;
    cursorY = 0;
    for ( i=0; i<64; i++)
       HT1632_LedMatrix_senddata(chipno,i,0);

}


 void HT1632_LedMatrix_senddata (uint8_t chipno, uint8_t i, uint8_t data )
{
        
  uint8_t   n_tx_buf[3] = {HT1632_ID_WR, i,0};           /**< TX buffer. */
  static const uint8_t  n_length = sizeof(n_tx_buf);
  static uint8_t       n_rx_buf[sizeof(n_tx_buf)+1];    /**< RX buffer. */
 // memset(n_rx_buf, 0, n_length);
  APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, n_tx_buf, n_length, n_rx_buf, n_length));
  
  //nrf_delay_ms(10);
}

void putString(int ane, int two, char *str) {
    cursorX = ane;
    cursorY = two;
    while(*str!='\0') {
        putChar( cursorX, two, *str++ );
        cursorX += 6;
    }
}

int putChar(int ane, int two, char c) {
  // fonts defined for ascii 32 and beyond (index 0 in font array is ascii 32);
  // CGRAM characters are in range 0 to 15 with 8-15 being repeat of 0-7
  // note we force y to be modulo 8 - we do not support writing character to partial y values.
 
  uint8_t charIndex;
  uint8_t colData;
  uint8_t numCols;
  uint8_t chipno;
  uint8_t addr;
  uint8_t colsLeft = 0;        // cols that didn't fit
 
  if( c > 15 )
    {
    // Regular characters
    // replace undisplayable characters with blank;
    if (c < 32 || c > 126)
     {
            charIndex = 0;
    }
     else
      {
            charIndex = c - 32;
    }
 
    // move character definition, pixel by pixel, onto the display;
    // fonts are defined as one byte per col;
      numCols=smallFont[charIndex][6];   // get the number of columns this character uses
      for (uint8_t col=0; col<numCols; col++) {
            colData = smallFont[charIndex][col];
       // chipno = chip_number(x,y);
        addr = chip_byte_address(ane,two); // compute which memory byte this is in
        if (ane <= aneMax && two <= twoMax) {
            shadowram[(addr>>1)+32*chipno] = colData;
            sendcol(chipno,addr,colData);
            ane++;
        } else {
            colsLeft++;
        }
    }
  } else {
    // CGRAM Characters
    charIndex = c & 0x07;       // Only low 3 bits count
    numCols=cgram[charIndex][0];    // get the number of columns this character uses
    // fonts are defined as one byte per col;
        for (uint8_t col=1; col<=numCols; col++) {
            colData = cgram[charIndex][col];
            //chipno=1;
        //chipno = chip_number(x,y);
        addr = chip_byte_address(ane,two); // compute which memory byte this is in
        if (ane <= aneMax && two <= twoMax) {
            shadowram[(addr>>1)+32*chipno] = colData;
            sendcol(chipno,addr,colData);
            ane++;
        } else {
            colsLeft++;
        }
    }
  }
 
  cursorX = ane;
  cursorY = two;
 //clear();
  return colsLeft;
}
void sendcol( uint8_t chipno,uint8_t address, uint8_t data)
{

    uint8_t   o_tx_buf[3] = {HT1632_ID_WR,address,data};  
    static const uint8_t o_length = sizeof(o_tx_buf);
    static uint8_t       o_rx_buf[sizeof(o_tx_buf)+1];    /**< RX buffer. */
   // memset(o_rx_buf, 0, o_length);
    APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, o_tx_buf, o_length, o_rx_buf, o_length));
 
}
 

after run the application getting the error like below

I am unable to find the cause of this error

 

thanks 

learn

Related