DSP56800E Quick Start error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DSP56800E Quick Start error

Jump to solution
2,450 Views
RGehring
Contributor II
Hello,

I am trying to combine two of the demo programs for the 56F8013 in the Quick Start sample applications.  Specifically the SCI and ADC demo.  I updated the appconfig.h from the SCI example with the ADC information. 
With the code below when I compile it with CW8, I keep getting a error that states:

"Link Error   :  Undefined : "Frx_char_hook"  Referenced from "FSci0RxFullISR" in scibf.c"
"Link Failed."
I looked through scibf.c and rx_char_hook is in there, not really sure why it is giving the error or what it means.  It may be because I don't have the correct files or values somewhere.  But if I start from either the SCI as a base or the ADC as a base project, they both get the same error(with exactly the same appconfig.h's).

Thanks for the help!


CODE:
#include "qs.h"
#include "sys.h"
#include "cop.h"
#include "adc.h"
#include "intc.h"
#include "gpio.h"
#include "occs.h"
#include "sci.h"
#include "../board.h"

char buff[] = "Sending ADC Values Test 1";


#define FALSE 0
#define TRUE  1
int BTN_PRS = FALSE;
adc_tBuff adc_Buff;

char adc_chr_buff[];

void main(void)
{
    volatile UWord16 w1, w0, w2, w3, w4, w5, w6, w7;
    UWord16 i;
    ioctl(COP, COP_INIT, NULL);
    ioctl(SYS, SYS_INIT, NULL);
   
    ioctl(GPIO_LEDS, GPIO_SETAS_GPIO, LED_R | LED_Y | LED_G | LED_R2 | LED_Y2 | LED_G2);
    ioctl(GPIO_LEDS, GPIO_SETAS_OUTPUT, LED_R | LED_Y | LED_G | LED_R2 | LED_Y2 | LED_G2);
    ioctl(GPIO_LEDS, GPIO_TOGGLE_PIN, LED_R | LED_Y | LED_G);
    ioctl(GPIO_LEDS, GPIO_SETAS_GPIO, BTN_0 | BTN_1);
    ioctl(GPIO_LEDS, GPIO_SETAS_INPUT, BTN_0 | BTN_1);
    ioctl(GPIO_LEDS, GPIO_PULLUP_ENABLE, BTN_0 | BTN_1);
    ioctl(GPIO_LEDS, GPIO_INT_ENABLE, BTN_0 | BIT_1);
   
    ioctl(ADC, ADC_INIT, NULL);
   
    ioctl(SCI_0, SCI_INIT, NULL);
    ioctl(SCI_0, SCI_SET_BAUDRATE, SCI_BAUD_9600);
    ioctl(SCI_0, SCI_TRANSMITTER, SCI_ENABLE);
    ioctl(SCI_0, SCI_RECEIVER, SCI_ENABLE);
    ioctl(SCI_0, SCI_BUFFERED_RX, SCI_ENABLE);
    ioctl(SCI_0, SCI_BUFFERED_TX, SCI_ENABLE);
 
    ioctl(INTC, INTC_INIT, NULL);
    archEnableInt();
   
//    write(SCI_0, BUFFERED, buff, sizeof(buff)-1);

    while(1)
    {
        for(i=0; i<50; i++)
              archDelay(0xffff);
          ioctl(GPIO_LEDS, GPIO_TOGGLE_PIN, LED_G2);
          ioctl(COP, COP_CLEAR_COUNTER, NULL);
        if(BTN_PRS == TRUE)
        {
            while(ioctl(ADC, ADC_GET_POWER_STATUS, ADC_CONVERTER_0 | ADC_CONVERTER_0 | ADC_VOLTAGE_REF)) { /* insert the checking of the other events if needed */ }
            ioctl(ADC, ADC_START, NULL);
               ioctl(GPIO_LEDS, GPIO_TOGGLE_PIN, LED_R);
            while (ioctl(ADC, ADC_GET_STATUS_CIP, NULL)) { /* insert the checking of the other events if needed */ }
            w0 = ioctl( ADC, ADC_READ_SAMPLE, 0);
            w1 = ioctl( ADC, ADC_READ_SAMPLE, 1);
            w2 = ioctl( ADC, ADC_READ_SAMPLE, 2);
            w3 = ioctl( ADC, ADC_READ_SAMPLE, 3);
            w4 = ioctl( ADC, ADC_READ_SAMPLE, 4);
            w5 = ioctl( ADC, ADC_READ_SAMPLE, 5);
            w6 = ioctl( ADC, ADC_READ_SAMPLE, 6);
            w7 = ioctl( ADC, ADC_READ_SAMPLE, 7);
            ioctl(ADC, ADC_READ_ALL_SAMPLES, adc_Buff);
            write(SCI_0, BUFFERED, buff, sizeof(buff)-1);
            BTN_PRS = FALSE;
        }
    }
}

#pragma interrupt on
void GPIO_ISR(void)
{

    UWord16 irqs = ioctl(GPIO_BTNS, GPIO_READ_INT_PENDING_REG, NULL);
    if(irqs & BTN_0)
    {
        ioctl(GPIO_LEDS, GPIO_TOGGLE_PIN, LED_R);
        BTN_PRS = TRUE;
        }
    if(irqs & BTN_1)
        ioctl(GPIO_LEDS, GPIO_TOGGLE_PIN, LED_R2);
    ioctl(GPIO_BTNS, GPIO_CLEAR_INT_PENDING, irqs);
}

#pragma interrupt off
0 Kudos
1 Solution
936 Views
RGehring
Contributor II
Ok, figured it out.  In case someone has a similar problem:

Since I was enabling the rx_char_hook interrupt in the appconfig.h it needed to be used in my code, so I had to add a function like so:

UWord16 rx_char_hook(UWord16 rxchar)
{
 //asm(nop);
}

The function just has to have something in it.  And I actually realized I needed the function anyway.

View solution in original post

0 Kudos
2 Replies
937 Views
RGehring
Contributor II
Ok, figured it out.  In case someone has a similar problem:

Since I was enabling the rx_char_hook interrupt in the appconfig.h it needed to be used in my code, so I had to add a function like so:

UWord16 rx_char_hook(UWord16 rxchar)
{
 //asm(nop);
}

The function just has to have something in it.  And I actually realized I needed the function anyway.

0 Kudos
936 Views
RGehring
Contributor II
I have it locked down to this part of the appconfig.h file:

#define INT_VECTOR_ADDR_32                Sci0RxFullISR
#define INT_PRIORITY_LEVEL_32             INTC_LEVEL0

Here is the appconfig.h file:

/*******************************************************************************
*
* File Name: appconfig.h
*
* Description: file for static configuration of the application
*              (initial values, interrupt vectors)
*
*****************************************************************************/

#ifndef __APPCONFIG_H
#define __APPCONFIG_H

/*.*************************************************************************
*
*  File generated by Graphical Configuration Tool Wed, 14/Jun/2006, 16:46:13
*
****************************************************************************.*/

#define MC56F8013
#define EXTCLK 8000000L
#define APPCFG_DFLTS_OMITTED 1
#define APPCFG_GCT_VERSION 0x02030002L

/*.
    OCCS Configuration
--------------------------------------------
    Core frequency: 32 MHz
    VCO frequency: 192 MHz
    Loss of lock interrupt 0: Disable
    Loss of lock interrupt 1: Disable
    Loss of reference clock Interrupt: Disable
    COP operation: Disable
    COP timeout: 8.38861 sec
    COP Runs in Stop Mode: Disable
    COP Runs in Wait Mode: Disable
    COP Write Protect: Disable
.*/
#define OCCS_PLLCR_INIT                   0x0082
#define OCCS_PLLDB_INIT                   0x0000
#define OCCS_USE_FACTORY_TRIM             1

/*.
    SYS Configuration
--------------------------------------------
    SIM: Power Saving Modes: Stop enabled , Wait enabled
         OnCE clock to HawkV2 core: Enabled when core TAP enabled
    Clock Output Mode: Off: 0
    SIM - Interrupts: Low voltage 2.2V: Disable
                      Low voltage 2.7V: Disable
    SIM - Peripheral clock: PWM A: Disable, SPI 0: Disable
                            SCI 0: Disable,
                            TMR A: Disable,
                            ADC A: Disable,
                            EMI: Disable
.*/
#define SIM_GPS_INIT                      0x0000
#define SIM_PCE_INIT                      0x2030

/*.
    SCI Configuration
--------------------------------------------
    Baudrate: 31250 bps
    Enable Receiver: Disable
    Enable Transmitter: Disable
    Data word length: 8 bits
    Parity: None
    Polarity: True polarity
    Loop mode: Disable
    Function in Wait Mode: SCI module enabled in Wait Mode
.*/
#define SCI_0_SCICR_INIT                  0x0030
#define SCI_0_SCICR2_INIT                 0x0000
#define SCI_0_HIGHLEVEL_MODE              2
#define SCI_0_RX_BUFFER_OKLIMIT           0x000F
#define SCI_0_RX_BUFFER_LOWLIMIT          0x000A
#define SCI_0_RX_BUFFER_SIZE              0x1E
#define SCI_0_TX_BUFFER_SIZE              0x1E
#define SCI_0_RX_XONXOFF                  0x01
#define SCI0CHAR                          char
#define SCI_0_RX_CHAR_HOOK                rx_char_hook

/*.
    FMSTR Configuration
--------------------------------------------
.*/
#define FMSTR_COMM_INTERFACE              1
#define FMSTR_LONG_INTR                   0
#define FMSTR_SHORT_INTR                  0
#define FMSTR_POLL_DRIVEN                 1

/*.
    ADC Configuration
--------------------------------------------
    Clock frequency: 5.33333 MHz
    Trigger source: Software only
    Channel Configuration: ANA0-ANA1: Single ended , ANA2-ANA3: Single ended
                           ANB0-ANB1: Single ended , ANB2-ANB3: Single ended
    Channel to Sample Mapping: SMP0: ANA0 , SMP1: ANA1 , SMP2: ANA2 , SMP3: ANA2
                               SMP4: ANB0 , SMP5: ANB1 , SMP6: ANB2 , SMP7: ANB2
    Scan Mode: Once sequential
    Enabled samples: SMP0 SMP1 SMP2 SMP3 SMP4 SMP5 SMP6 SMP7
    Zero crossing mode: SMP0: Disabled , SMP1: Disabled , SMP2: Disabled , SMP3: Disabled
                        SMP4: Disabled , SMP5: Disabled , SMP6: Disabled , SMP7: Disabled
    Auto Power Down Mode: Disable
    Auto Stand-by Mode: Disable
    Power down converter A (ANA0-ANA3): No
    Power down converter B (ANB0-ANB3): No
    Power down voltage reference: No
    Power up delay: 13, Delay: 2.4375 us
    VREFLO source: ANB2 Pin
    VREFH  source: ANA2 Pin
    Interrupts: ANA Conversion complete: Disabled
                High limit error: Disabled
                Low limit error: Disabled
                Zero crossing: Disabled
.*/
#define ADC_ADCR1_INIT                    0x0000
#define ADC_ADCR2_INIT                    0x0002
#define ADC_ADLST1_INIT                   0x2210
#define ADC_ADLST2_INIT                   0x6654
#define ADC_ADCPOWER_INIT                 0x00D0

/*.
    GPIO_A Configuration
--------------------------------------------
    Pin  0: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull ,
    Pin  1: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull ,
    Pin  2: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull ,
    Pin  3: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull ,
    Pin  4: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull ,
    Pin  5: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull ,
    Pin  6: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
    Pin  7: Function: RESET_B , PullUp: Enable ,
.*/
#define GPIO_A_DDR_INIT                   0x003F
#define GPIO_A_PER_INIT                   0xFF80

/*.
    GPIO_B Configuration
--------------------------------------------
    Pin  0: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
    Pin  1: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
    Pin  2: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
    Pin  3: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
    Pin  4: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
    Pin  5: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
    Pin  6: Function: RXD , PullUp: Enable ,
    Pin  7: Function: TXD , PullUp: Enable ,
.*/
#define GPIO_B_PER_INIT                   0xFFC0

/*.
    INTC Configuration
--------------------------------------------
    All maskable interrupts disabled: No
.*/
#define INTC_ICTL_INIT                    0x0000
#define INT_VECTOR_ADDR_28                Sci0TxEmptyISR
#define INT_PRIORITY_LEVEL_28             INTC_LEVEL0
#define INT_VECTOR_ADDR_31                Sci0RxErrorISR
#define INT_PRIORITY_LEVEL_31             INTC_LEVEL0
#define INT_VECTOR_ADDR_32                Sci0RxFullISR
#define INT_PRIORITY_LEVEL_32             INTC_LEVEL0

/*.         End of autogenerated code
********************************************************************** ..*/

#endif

0 Kudos