Bare Minimum For Firmware Manager

Hello!

I am working with a B40 module and need to program a firmware onto it. I have a custom board to work with it using an STM32f7NI host processor. I have gotten and worked though the example code, but even with it running with no errors I do not see the module on my network. What is the bare minimum to get to this point where I can then use Firmware Manager to change the protocol of the B40?

Thanks,
Casey Timm
Safari Circuits

Hi Casey,

I have a few questions for you:

  • Which CompactCom B40 are you using?
  • Also do you have a starter kit with this board?
  • Which protocol are you trying to set the B40 to?
  • Is the device showing up in HMS IPconfig or responding to pings?

Thanks,
-Tim

Tim,

  • Looks like my order code was (PNCB40-AB6774) [AB6774-C]
  • Not yet I put in a PO for one today with my Rep.
  • Ether/IP
  • No

I have a little more information. I implemented the debug print and got this out. It looks like I am getting a watchdog timeout, but in my main loop APPL_HandleAbcc() always returns no error.

Mem: Buffer allocated: 0x20000a8c
Command queued: MsgBuf:0x20000a8c SrcId:0x01
Outstanding commands: 1
ANB_STATUS: ABP_ANB_STATE_SETUP
ABCC watchdog timeout

My main loop if it is prevalent.

 while (1)
  {
    eAbccHandlerStatus = APPL_HandleAbcc();
    ABCC_RunTimerSystem(1);
    switch (eAbccHandlerStatus)
    {
    case APPL_MODULE_NO_ERROR:
      break;
    default:
      can_send_message(ERROR_ENDPOINT, &eAbccHandlerStatus, 1, &hcan1);
      break;
    }
    //can_handler(&hcan1);
    HAL_Delay(1);
  }

Tim,

Sorry for spamming a few replies. I got further, now I know I am in the run mode of the state machine, but still don’t see the module on my network.

Here is my current debug output

Mem: Buffer allocated: 0x20000a8c
CmdSeq(80112c8)->DataFormatCmd()
CmdQ status: 1(2)
ANB_STATUS: ABP_ANB_STATE_SETUP
Command dequeued: MsgBuf:0x20000a8c SrcId:0x01

Using my IDE’s debugger I can also see that I am in the state APPL_RUN.

I assume that means communication to the module from my host processor is working. What am I missing for getting it onto the network so I can flash firmware onto the module?

Thanks,
Casey Timm

Hi Casey,

Does the device show up in IPconfig if you’re using the default SDK? Can you try and run this section of code and see if you can get onto the web server using the device’s IP address?

. This code was based off of UpdateIpAddress function seen in the same appl_abcc_handler.c file and should print the ip address to the debug console

/*------------------------------------------------------------------------------
** Forward declarations
**------------------------------------------------------------------------------
*/

static ABCC_CmdSeqRespStatusType HandleExceptionResp( ABP_MsgType* psMsg );
static ABCC_CmdSeqRespStatusType HandleExceptionInfoResp( ABP_MsgType* psMsg );
static ABCC_CmdSeqCmdStatusType ReadExeption( ABP_MsgType* psMsg );
static ABCC_CmdSeqCmdStatusType ReadExeptionInfo( ABP_MsgType* psMsg );
static ABCC_CmdSeqCmdStatusType UpdateNodeAddress( ABP_MsgType* psMsg );
static ABCC_CmdSeqCmdStatusType UpdateIpAddress( ABP_MsgType* psMsg );
static ABCC_CmdSeqCmdStatusType UpdateNetmask( ABP_MsgType* psMsg );
static ABCC_CmdSeqCmdStatusType UpdateGateway( ABP_MsgType* psMsg );
static ABCC_CmdSeqCmdStatusType UpdateDhcp( ABP_MsgType* psMsg );
static void UpdateAddressDone( void );
static ABCC_CmdSeqCmdStatusType UpdateBaudRate( ABP_MsgType* psMsg );
static void UpdateBaudRateDone( void );
static ABCC_CmdSeqCmdStatusType ReadSerialNum(ABP_MsgType* psMsg);
static ABCC_CmdSeqCmdStatusType PrintSerialNumber(ABP_MsgType* psMsg);

static ABCC_CmdSeqCmdStatusType ReadIpAddress(ABP_MsgType* psMsg);
static ABCC_CmdSeqCmdStatusType PrintIpAddress(ABP_MsgType* psMsg);

/*------------------------------------------------------------------------------
** User init sequence. See abcc_cmd_seq_if.h
**------------------------------------------------------------------------------
*/
static const ABCC_CmdSeqType appl_asUserInitCmdSeq[] =
{
ABCC_CMD_SEQ( UpdateIpAddress, NULL ),
ABCC_CMD_SEQ( UpdateNetmask, NULL ),
ABCC_CMD_SEQ( UpdateGateway, NULL ),
ABCC_CMD_SEQ( UpdateDhcp, NULL ),
ABCC_CMD_SEQ( UpdateNodeAddress, NULL ),
ABCC_CMD_SEQ( UpdateBaudRate, NULL ),
ABCC_CMD_SEQ( ReadSerialNum , PrintSerialNumber ),
ABCC_CMD_SEQ( ReadIpAddress , PrintIpAddress ),
ABCC_CMD_SEQ_END()
};

//
// Function to grab the IP address of the device
//

static ABCC_CmdSeqCmdStatusType ReadIpAddress(ABP_MsgType* psMsg)
{
ABCC_GetAttribute(psMsg, ABP_OBJ_NUM_NC, 3, ABP_NC_VAR_IA_VALUE, ABCC_GetNewSourceId());
return (ABCC_SEND_COMMAND);
}

//
// Response for the IP Address grab
//

static ABCC_CmdSeqRespStatusType PrintIpAddress(ABP_MsgType* psMsg)
{
UINT32 dipaddr;

if (ABCC_VerifyMessage(psMsg) != ABCC_EC_NO_ERROR)
{
APPL_UnexpectedError();
return(ABCC_EXEC_NEXT_COMMAND);
}

ABCC_GetMsgData32(psMsg, &dipaddr, 0);

//Do whatever you need to do with the response

ABCC_PORT_DebugPrint((“IP Address from Tim: %X\n\n”, dipaddr));

return (ABCC_EXEC_NEXT_COMMAND);
}

Tim,

A little egg on my face. I had some spi issues preventing things from working right. I fixed them and now I see network activity from the device, and can see it in the firmware manager. Sorry for taking up your time unnecessarily.

Thanks,
Casey Timm

Hi Casey,

That’s alright, glad to hear you got it working!