• AVR Freaks

Hot!error: 'PORT_CHANNEL_A' undeclared here (not in a function)

Author
WalterH
Starting Member
  • Total Posts : 56
  • Reward points : 0
  • Joined: 2007/02/25 07:06:21
  • Location: Austria
  • Status: offline
2018/11/03 12:05:34 (permalink)
0

error: 'PORT_CHANNEL_A' undeclared here (not in a function)

Hi,
 
I created a new Harmony 2.06 project. Some peripherals added. Compiling this project, the I2C peripheral always rises an error. 
 
In file included from ../src/system_config/default/system_init.c:49:0:
../src/system_config/default/system_config.h:136:57: error: 'PORT_CHANNEL_A' undeclared here (not in a function)
#define DRV_SCL_PORT_IDX0 PORT_CHANNEL_A
^
../src/system_config/default/system_init.c:110:16: note: in expansion of macro 'DRV_SCL_PORT_IDX0'
.portSCL = DRV_SCL_PORT_IDX0,
 
I did not find a declaration for "PORT_CHANNEL_A" in this project. Did I miss something? 
Project added as zip archive.
 
Any ideas?
thanks
 
 
 
#1

8 Replies Related Threads

    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: error: 'PORT_CHANNEL_A' undeclared here (not in a function) 2018/11/03 16:04:43 (permalink)
    5 (1)
    What PIC are you using?
    (Why do so many people fail to mention this crucial point?)

    Nearly there...
    #2
    WalterH
    Starting Member
    • Total Posts : 56
    • Reward points : 0
    • Joined: 2007/02/25 07:06:21
    • Location: Austria
    • Status: offline
    Re: error: 'PORT_CHANNEL_A' undeclared here (not in a function) 2018/11/04 00:30:42 (permalink)
    0
    Sorry, this is a PIC32MX695F512H. 
     
    #3
    vloki
    Jo, alla!
    • Total Posts : 6803
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: error: 'PORT_CHANNEL_A' undeclared here (not in a function) 2018/11/04 02:43:16 (permalink)
    4 (1)
    Similar issue with PIC32MX795F512H.
    Harmony always adds some code for initializing PORTA - but there is no PORTA :-(
    Just delete it...
    post edited by vloki - 2018/11/04 03:02:12

    Uffbasse !
    #4
    vloki
    Jo, alla!
    • Total Posts : 6803
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: error: 'PORT_CHANNEL_A' undeclared here (not in a function) 2018/11/04 03:32:17 (permalink)
    0
    WalterHProject added as zip archive.
    See -> http://microchipdeveloper...plabx:projects-package



    Uffbasse !
    #5
    WalterH
    Starting Member
    • Total Posts : 56
    • Reward points : 0
    • Joined: 2007/02/25 07:06:21
    • Location: Austria
    • Status: offline
    Re: error: 'PORT_CHANNEL_A' undeclared here (not in a function) 2018/11/05 12:30:29 (permalink)
    0
    Hi,
     
    I digged into this issue. The processor declaration files stored in:
     C:\microchip\harmony\v2_06\framework\peripheral\ports\processor,
     
     
    file: ports_p32mx270f256b.h contains this declaration:
     
    typedef enum {
    PORT_CHANNEL_A = 0x00,
    PORT_CHANNEL_B = 0x01
    } PORTS_CHANNEL;
     
    Unfortunately the file ports_p32mx695f512h.h contains this declaration:
     
    typedef enum {
    PORT_CHANNEL_B = 0x01,
    PORT_CHANNEL_C = 0x02,
    PORT_CHANNEL_D = 0x03,
    PORT_CHANNEL_E = 0x04,
    PORT_CHANNEL_F = 0x05,
    PORT_CHANNEL_G = 0x06
    } PORTS_CHANNEL;
     
    So the declaration "PORT_CHANNEL_A = 0x00," is missing for the p32mx695f512h cpu. 
    To initialize the first i2c device, we need "PORT_CHANNEL_A = 0x00" declared.
     
    Any ideas why this declaration is missing? 
     
    #6
    vloki
    Jo, alla!
    • Total Posts : 6803
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: error: 'PORT_CHANNEL_A' undeclared here (not in a function) 2018/11/05 12:38:45 (permalink)
    0
    Because the device does not have a porta?

    Uffbasse !
    #7
    WalterH
    Starting Member
    • Total Posts : 56
    • Reward points : 0
    • Joined: 2007/02/25 07:06:21
    • Location: Austria
    • Status: offline
    Re: error: 'PORT_CHANNEL_A' undeclared here (not in a function) 2018/11/05 12:44:47 (permalink)
    0
    But the i2c declaration require this statement:
     
    This is part of system_config.h and requires PORT_CHANNEL_A:
     
    /* I2C Driver Configuration Options
    */
    #define DRV_I2C_INTERRUPT_MODE true
    #define DRV_I2C_CLIENTS_NUMBER 1
    #define DRV_I2C_INSTANCES_NUMBER 1
    #define DRV_I2C_PERIPHERAL_ID_IDX0 I2C_ID_1
    #define DRV_I2C_OPERATION_MODE_IDX0 DRV_I2C_MODE_MASTER
    #define DRV_SCL_PORT_IDX0 PORT_CHANNEL_A
    #define DRV_SCL_PIN_POSITION_IDX0 PORTS_BIT_POS_14
    #define DRV_SDA_PORT_IDX0 PORT_CHANNEL_A
    #define DRV_SDA_PIN_POSITION_IDX0 PORTS_BIT_POS_15
     
    #8
    vloki
    Jo, alla!
    • Total Posts : 6803
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: error: 'PORT_CHANNEL_A' undeclared here (not in a function) 2018/11/05 13:07:59 (permalink)
    0
    I think there is something wrong with the "H' devices of that family in Harmony.
    I2C1 would be correct on porta14/15 on a "L" device.
    (sorry I'm just a beginner with pic32 and harmony but I'm pretty sure there is no porta and I2C1 is on portd8/9!)
    post edited by vloki - 2018/11/05 13:11:18

    Uffbasse !
    #9
    Jump to:
    © 2019 APG vNext Commercial Version 4.5