Qt shows error
-
wrote on 26 Mar 2019, 06:03 last edited by
Run the following code then this error shows :The program has unexpectedly finished.
void MainWindow::on_Tx_clicked()
{
bcm2835_spi_begin();
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0,0);
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS1,0);
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_128);
bcm2835_spi_setDataMode(BCM2835_SPI_MODE3);
bcm2835_spi_chipSelect(BCM2835_SPI_CS0);uint8_t data; data = bcm2835_spi_transfer((uint8_t)0x55); ui->textBrowser->setText(QString::number(data));
}
-
Run the following code then this error shows :The program has unexpectedly finished.
void MainWindow::on_Tx_clicked()
{
bcm2835_spi_begin();
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0,0);
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS1,0);
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_128);
bcm2835_spi_setDataMode(BCM2835_SPI_MODE3);
bcm2835_spi_chipSelect(BCM2835_SPI_CS0);uint8_t data; data = bcm2835_spi_transfer((uint8_t)0x55); ui->textBrowser->setText(QString::number(data));
}
@Rameshwar said in Qt shows error:
The program has unexpectedly finished.
Use a debugger and find out where it crashes. Most likely you are de-referencing an uninitialized or no longer valid pointer.
Regards
-
@Rameshwar said in Qt shows error:
The program has unexpectedly finished.
Use a debugger and find out where it crashes. Most likely you are de-referencing an uninitialized or no longer valid pointer.
Regards
-
wrote on 29 Mar 2019, 12:23 last edited by
When run the above code then it displays "process killed by signal". how to solve it, please help me.
-
wrote on 15 Apr 2023, 12:17 last edited by
Check return value from bcm2835_spi_begin() function;
Maybe 0...