NP40 anybus porting to MSP432

I’m trying to use a profibus HMS NP40 module with a TI MSP432 Arm CPU.

I’ve managed to compile and run a simple port of the Starter Kit example SPEED_EXAMPLE

I use spi communication with the module and that seems to work, but unfortunately I have the anbstatus stuck to 0x02 (WAIT_PROCESS) and never goest to 0x04 (PROCESS_ACTIVE)

At the moment I have a profibus master running but I cannot connect to the slave because I don’t know what is its station number.

Anyone is able to help me to test that example and let the master communicate with the slave?

Hello @Merlin,

Do you know if you are able to find the device on the bus once it make it to WAIT_PROCESS? It sounds like the device is initialized but waiting for communication from the master. You would need to assign a station number from the master and/or master configuration software.


Hello, thanks,
I’m using a custom profibus master so I don’t know if I’m able to assign it a station number from there.

Anyway I was able to assign an address and baudrate to the slave by using
within the code.

At this point I’m able to find the slave but the master sees an error and says to me that slave is not correctly parametrized…
I’m trying to use speed example which should work… is it probably a wrong configuration in the master or do I have to check something in the slave example?

What is the exact error on the plc? Perhaps you are using the wrong GSD file or not using the correct parameters from the GSD for the example you are using?

I’m porting an Anybus NP40 module on a MSP432.

I’m using the project from the starter kit, the one that is already done for some targets.
I successfully ported the HMS driver on my CPU, I use SPI to communicate to the module.

I compiled the first example, the one defined with APPL_ADI_SETUP_SPEED_EXAMPLE
At first I wasn’t able to communicate from the master to the slave, then I realized I had to set slave address and baud rate using


Into the APPL_HandleAbcc( void ) function, just after the following section:

if( ABCC_StartDriver( lStartupTimeMs ) == ABCC_EC_NO_ERROR )

I also defined to true the DPV1_OBJ_ENABLE symbol.

Now I’m able to communicate (master sees the slave) but my master tells me that slave is wrong parametrized. I have just defined two words one for input and one for output as should be with the “speed example”.

What should I do to fix the problem in your opinion?
Thank you.

yes, I have to check the master, in the meantime could you point me to the code that actually map the ProcessData to the module?

I mean, in the speed example we have just two uint16 variables (one for write and other for read) that should be exchanged via profibus. Where is the code that set this map into the HMS module? (So I can check if this is correctly done or what is actually mapped, in order to configure master accordingly)


The example I’m using should use just two variables:

const AD_AdiEntryType APPL_asAdiEntryList[] =
{ 0x1, “SPEED”, ABP_UINT16, 1, APPL_WRITE_MAP_READ_ACCESS_DESC, { { &appl_iSpeed, &appl_sUint16Prop } } },
{ 0x2, “REF_SPEED”, ABP_UINT16, 1, APPL_READ_MAP_WRITE_ACCESS_DESC, { { &appl_iRefSpeed, &appl_sUint16Prop } } }

const AD_MapType APPL_asAdObjDefaultMap[] =

My master doesn’t use the gsd, I have to write into it the profibus configuration bytes by hand.

So the speed example does automatically generate a Profibus configuration bytes (and if so where?) or do I have to write configuration bytes to the module from the host application? (if so, how?)

IN example if I would like to divide in different modules my process image or I would like to activate profibus module consistency for some module, how should I do that?

Hello @Merlin,
The ADI list should be where the data mapping is being handled. This mapping should match the mapping for the profibus master. I am not exactly sure what you need in regards to configuration bytes. Perhaps the following will help.

The order in which ADIs are mapped to Process Data is significant and must be replicated in the PROFIBUS master when setting up the network communication (i.e. the I/O modules must be set up in the same order, and with the same size and direction, as the mapped ADIs). If not taken into account, the network connection establishment will fail and no communication will take place

From section 4.4 of the user guide:

Application Data Instances (ADIs)
ADIs can be accessed acyclically from the network using DP-V1 read/write services. The module translates these services into object requests towards the Application Data Object. If the host application responds with an error to such a request, the error code in the response will be translated to DP-V1 standard.

If the Modular Device Object is implemented in the application, the addressing of ADIs is carried out in accordance with the Modular Device Object. For more information, see Modular Device Object (ECh), p. 35. If the Modular Device Object is not implemented, ADIs are mapped to slots and indexes as follows:
ADI = slot • 255 + index + 1
slot = (ADI - 1) / 255
index = (ADI - 1) MOD 255

ADI Slot Index
256 1 0
510 1 0
65025 254 254