2008-08-15 22:35:37     touch screen crash with misaligned address violation

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-08-15 22:35:37     touch screen crash with misaligned address violation

Bo Zhuang (CANADA)

Message: 60517   

 

Hi guys,

 

We are trying to get the ADS7846 touch screen controller work for our custom board. The kernel seems recognized the touch screen as shown in the following booting message.

 

....

 

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@4

bfin-spi bfin-spi.1: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc02300, dma channel@5

input: gpio-keys as /class/input/input0                                                                     

ads7846 spi0.2: touchscreen, irq 115                             <---                                                                

input: ADS784x Touchscreen as /class/input/input1        <---                                                    

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0                                                    

rtc-bfin rtc-bfin: setting the system clock to 2059-09-16 00:52:01 (2830899121)                             

Freeing unused kernel memory: 5064k freed                                                                   

hostname: applet not found  

 

....

 

 

 

However, when we hit the screen in a user application, it crashs and the log is:

 

Data access misaligned address violation

- Attempted misaligned data memory or data cache access.

Kernel OOPS in progress

Defered Exception context

CURRENT PROCESS:

COMM=ksoftirqd/0 PID=3

invalid mm

return address: [0x000c9384]; contents of:

0x000c9360:  0127  05bd  0010  0000  04c5  3228  aca9  6c41

0x000c9370:  9508  e528  0018  e52a  0019  6fc1  0a42  181e

0x000c9380:  6042  6c61 [9500] 9708  aca9  6c41  9508  5410

0x000c9390:  0c00  6fc1  180a  0000  6041  aca9  6c41  9508

 

SEQUENCER STATUS:               Not tainted

SEQSTAT: 00000024  IPEND: 8030  SYSCFG: 0006

  HWERRCAUSE: 0x0

  EXCAUSE   : 0x24

  physical IVG15 asserted : <0xffa00dc4> { _evt_system_call + 0x0 }

  logical irq   6 mapped  : <0xffa00250> { _timer_interrupt + 0x0 }

  logical irq   9 mapped  : <0x00097e98> { _bfin_bf54x_irq_error + 0x0 }

  logical irq  42 mapped  : <0x000acb7c> { _bfin_serial_dma_rx_int + 0x0 }

  logical irq  43 mapped  : <0x000acaec> { _bfin_serial_dma_tx_int + 0x0 }

  logical irq  68 mapped  : <0x000c81e0> { _bfin_ata_interrupt + 0x0 }

  logical irq 115 mapped  : <0x000d1200> { _ads7846_irq + 0x0 }

  logical irq 127 mapped  : <0x000d0c70> { _gpio_keys_isr + 0x0 }

  logical irq 128 mapped  : <0x000d0c70> { _gpio_keys_isr + 0x0 }

  logical irq 129 mapped  : <0x000d0c70> { _gpio_keys_isr + 0x0 }

  logical irq 130 mapped  : <0x000d0c70> { _gpio_keys_isr + 0x0 }

RETE: <0x00000000> /* Maybe null pointer? */

RETN: <0x03dedf28> /* unknown address */

RETX: <0x000c9384> { _u16_writer + 0x1c }

RETS: <0x000c9b64> { _pump_transfers + 0x188 }

PC  : <0x000c9384> { _u16_writer + 0x1c }

DCPLB_FAULT_ADDR: <0xffc0050c> /* unknown address */

ICPLB_FAULT_ADDR: <0x000c9384> { _u16_writer + 0x1c }

 

....

 

We set the driver for the touch screen as (in the mach-bf548/boards/..):

 

static struct bfin5xx_spi_chip spi_ads7846_chip_info = {

        .cs_change_per_word = 0,

        .enable_dma = 0,

        .bits_per_word = 16,

};

static int ads7843_pendown_state(void)

{  

 

      return !gpio_get_value(GPIO_PA12);

}

static struct ads7846_platform_data bfin_ads7846_ts_info = {

    .model            = 7846,

    .x_min            = 0,

    .x_max            = 4095,

    .y_min            = 0,

    .y_max            = 4095,

    .vref_delay_usecs    = 100,

    .x_plate_ohms        = 450,

    .y_plate_ohms        = 250,

    .pressure_max        = 15000,

    .debounce_max        = 1,

    .debounce_rep        = 0,

    .debounce_tol        = (~0),

    .get_pendown_state    = ads7843_pendown_state,

};

 

#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)

{

        .modalias               = "ads7846",

        .platform_data          = &bfin_ads7846_ts_info,

        .irq                    = IRQ_PA12,

        .max_speed_hz           = 125000 * 26,     /* max spi clock (SCK) speed in HZ */

        .bus_num                = 0,

        .chip_select            = 2,        // It looks like this specifies the SPI port. For Blueberry we are on SPI2

        .controller_data = &spi_ads7846_chip_info,

},

#endif

 

Any wrong setting causes the non-aligned memory access? The touch screen is not responsive when setting .bits_per_word to a value other than 16.

 

 

 

Thanks a lot.

 

Bo

QuoteReplyEditDelete

 

 

2008-08-15 23:44:51     Re: touch screen crash with misaligned address violation

Mike Frysinger (UNITED STATES)

Message: 60518   

 

this page shows how to use dump messages to find the problem:

http://docs.blackfin.uclinux.org/doku.php?id=debuging_applications#unaligned_data_access

Attachments

    Outcomes