IMM101T-046M program motor parameter file through MCU

Announcements

From sunburn to sun earn – we’ve got the power! Watch our #poweringgreen videos now.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MathanRaja
Level 4
Level 4
100 sign-ins 10 questions asked 25 replies posted

Hi

Is it possible to program motor parameter file through MCU without MCE Designer? If yes, How?

Thanks

Mathan

0 Likes
1 Solution
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @MathanRaja,

Please make sure you are connecting to UART0 of MCE and Please make sure UART0 is not configured as user UART 

We have tried sending below command and got below response

Krupashankar_0-1649066520583.png

Connection: Baud rate 115200

RXD0(MCE)- TX( STM32 in your case)

TXD0(MCE)- RX ( STM32 in your case)

GND(MCE) - GND ( STM32 in your case)

Please wait for at least( 100ms) after sending the command and try sending multiple ( 2-3) times if there is no reply

 

Thanks,

Krupashankar

View solution in original post

0 Likes
14 Replies
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @MathanRaja,

Yes, You can program using MCU without using MCE

For programming iMotion device you could refer to Application note: AN2018-33 iMOTION™ 2.0 Device Programming

 

Thanks,

Krupashankar

0 Likes
MathanRaja
Level 4
Level 4
100 sign-ins 10 questions asked 25 replies posted

Hi Krupashankar,

For now, I am controlling the motor by stm32f3. what I need means,

we have been using IMM101T-046M in our two projects. There is a difference in both projects in the motor parameter file. So, I am investigating, Is it possible to keep parameters and Firmware of the IMM101T files inside the stm32 project. Depending upon the project selection the parameter file should upload to the IMM chip from MCU.

If it is possible,

How to do that? 

can I get an example code for this?

Thanks

Mathan

0 Likes
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @MathanRaja,

Yes, that is possible, iMotion device EVAL-M1-101TF allows you to select different parameters based on the motor.

 We presently don't have a code example to program parameters using external MCU. 

 

Thanks,

Krupashankar

0 Likes
MathanRaja
Level 4
Level 4
100 sign-ins 10 questions asked 25 replies posted

Hi Krupashankar,

Can you give any guidance on how & where to start the code?

Are there any other eval boards code available? please share that with me. I will change that code to mine.

what type of file format do I have to use like bin or file system or direct format?

Thanks

Mathan

0 Likes
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @MathanRaja,

You can follow the below steps and presently we don't have any existing code example

  • To ease the application, it would be good to first program the iMotion controller with valid firmware and parameters using the design wizard.
  • Generate a combined *.ldf file for your program using the MCE wizard, this will have firmware, parameter, and script in hex format in different sections.
  • Extract the parameter section from the combined file and save it in the stm32 processor(as per your firmware design)
  • Now change the operating mode to config mode (follow section 5.3 in AN2018-33)

Krupashankar_0-1648476446101.png

 

 

  • On successful validation the device restarts in the config mode.
  • Please see the sample parameter data on the *.ldf file as below(open the file in Notepad)

%---------------------

% Page 00 - AppID 01

%---------------------

% Erase Parameter Set

a0 22 00 01 00

% Program Parameter Set

a0 20 00 01 40 ef a8 00 00 01 65 01 00 75 73 62 2d 33 72 64 2d 00 00 00 01 05 00 02 00 02 00 c8 00 30 00 30 00 13 00 c0 00 60 00 00 00 8f 00 c5 0a 63 05 5e 0b e8 03 00 00 00 00 60 00 99 03 c8 00 00 00 e8 03

a0 20 00 01 40 00 00 00 00 33 00 00 00 00 10 64 00 1e 00 06 00 00 10 cd 00 70 17 66 0e ff 7f a4 00 70 17 00 44 8a 07 d4 00 df 30 c8 00 10 00 ab 03 00 40 1f 05 e9 04 0b 00 a0 24 ec 37 00 10 ab 00 2f 11 3f 00

a0 20 00 01 40 39 00 1e 02 e8 08 20 00 00 00 6e 13 f9 00 c1 02 00 10 f4 01 d9 04 33 03 00 00 00 00 00 00 08 00 01 00 02 00 82 00 78 00 48 71 00 08 88 13 70 17 04 00 03 64 00 00 00 00 00 00 55 55 5a 00 3c 00

a0 20 00 01 40 20 01 00 08 50 01 3f 00 04 00 33 03 e8 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

% Check Parameter Set

a0 21 00 01 00

 

  • On the serial link first send the “Erase Parameter Set” data of the page you want to erase, wait for the response.
  • Once the response is received send the “Program Parameter Set” one line at a time and wait for the response.
  • After all the lines under the “Program Parameter Set” are transmitted. Send the “Check Parameter Set” data on the serial link
  • The process has to be repeated for each parameter block as per the design.
  • After all the parameters are updated change the mode of operation to application mode using the following command

 

Command

CHANGE_BOOT_MODE

           
                 

Syntax

 

CLA

INS

P1

P2

Lc

Datafield

Le

   

0xA0

0x18

mode

~mode

-

-

0x00

                 

Response

 

Data filed

SW1

SW2

Status

   

rParsStatus

0x90

0x00

Success, then change to new mode

   

 

0x65

0x81

NVM programming error

   

 

0x69

0x84

Missmatch between mode and ~mode

   

 

0x6A

0x86

Wrong boot mode

 

Krupashankar_1-1648476446107.png

 

 

After this command is sent the system sends a reply and restarts in the selected mode of operation.

 

Thanks,

Krupashankar

 

0 Likes
MathanRaja
Level 4
Level 4
100 sign-ins 10 questions asked 25 replies posted

Hi Krupashankar,

Thanks for your steps.

Before going to implement steps. I have to establish the communication between stm32 and IMM with device programming commands.

I can able to control the motor through user UART with a 57600 baud rate. 

So I have used the same (57600) baud rate and 115200 for this device's programming commands. 

But both 57600 and 115200 baud rates. I didn't get any response from IMM.

How do fix this?

Here is my code:

uint8_t Connect[] = {0x00,0x6C};
uint8_t Get_Status[] = { 0xA0, 0x10, 0x00, 0x00};
uint8_t Check_Comm[] = {0x7E, 0x13, 0x7E, 0x13};
uint8_t SBSL[] = { 0x7E, 0x02, 0x80, 0x31, 0x51, 0x81, 0x10, 0xFA, 0xF8, 0x7E, 0x87};

uint8_t  RX_Temp_Buffer[8];

HAL_UART_Receive_IT(&huart1, RX_Temp_Buffer, 8);

while (1)
{
HAL_UART_Transmit(&huart1, Connect, sizeof(Connect), HAL_MAX_DELAY);
HAL_UART_Transmit(&huart1, Get_Status, sizeof(Get_Status), HAL_MAX_DELAY);
HAL_UART_Transmit(&huart1, Check_Comm, sizeof(Check_Comm), HAL_MAX_DELAY);
HAL_UART_Transmit(&huart1, SBSL, sizeof(SBSL), HAL_MAX_DELAY);
}

Here you can see the response of Motor control commands but there is no response for device programming commands.

MathanRaja_0-1648711448002.png

 

Thanks

Mathan

0 Likes
Viswa
Moderator
Moderator
Moderator
10 likes received 50 solutions authored 100 replies posted

Hi Mathan

Assuming you already have an application on the iMotion controller,

We recommend to use 115200 baud.

When there is already an application we need to use the following command

Check_Comm[] = {0x7E, 0x13, 0x7E, 0x13}; --> As written by you in earlier query

to establish communication with the controller.

Reply would be as below

0x7E 0x17 0x7E 0x17 (or)

0x7E 0x1B 0x7E 0x1B

Once this is received please use the command to place the unit in Config mode

Refer section 5.3 of document AN2018-33.

Please refer section 6.4 for a step by step process of the same.

0 Likes

Hi Viswa,

Thanks for your reply and support.

I have tried whatever you mentioned. But it didn't work. I didn't get any response from IMM.

Thanks

Mathan

0 Likes
MathanRaja
Level 4
Level 4
100 sign-ins 10 questions asked 25 replies posted

Hi Krupa Shankar,

FYI

For now, I am getting responses from IMM while using catch-up methods(57600) (Refer 5.4). In this method, I have gotten responses for the following commands. connect, change the boot mode, etc. But If I operate IMM a normal way. There is no response even regarding connect and change boot mode commands. 

 

Note: I am waiting for the solution

Thanks

Mathan

 

0 Likes
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @MathanRaja,

Please make sure you are connecting to UART0 of MCE and Please make sure UART0 is not configured as user UART 

We have tried sending below command and got below response

Krupashankar_0-1649066520583.png

Connection: Baud rate 115200

RXD0(MCE)- TX( STM32 in your case)

TXD0(MCE)- RX ( STM32 in your case)

GND(MCE) - GND ( STM32 in your case)

Please wait for at least( 100ms) after sending the command and try sending multiple ( 2-3) times if there is no reply

 

Thanks,

Krupashankar

0 Likes

Hi Krupashankar,

How to modify static parameter using user UART (Interfaceconf0 = 1 (user UART) to Interfaceconf0 = 7 (MCE)?

Thanks

Mathan

0 Likes

 

HI Krupashankar,

I have configured IMM as MCE communication and disabled user UART.

Now I have connected IMM to the dock light through the onboard debugger and I have tried device programming commands ( connect and check communication) and it is worked.

Then I connected stm32 (Tx, Rx) to IMM (RXD0, TXD0) and I have sent device programming commands. But I didn't get any response.

Then I connected stm32 (Tx, Rx) to IMM (TX, RX). Now also no response in RXD0 & TXD0.

if users want to use the device programming command. It will happen in MCE mode. If the user wants to control the motor. it will happen in user UART mode.

Can you confirm am I right?

Is it possible to use all types of commands in the User UART mode? If not, then how to change MCE to user UART mode and vice versa, using the stm32 project? 

Thanks

Mathan

0 Likes

Hi @MathanRaja,

I have configured IMM as MCE communication and disabled user UART.

Now I have connected IMM to the dock light through the onboard debugger and I have tried device programming commands ( connect and check communication) and it is worked.

Then I connected stm32 (Tx, Rx) to IMM (RXD0, TXD0) and I have sent device programming commands. But I didn't get any response.

Then I connected stm32 (Tx, Rx) to IMM (TX, RX). Now also no response in RXD0 & TXD0.

Yes, we should disable user UART and configure it as MCE UART. If we are able to communicate with Docklight, then we should be able to communicate with STM32. Please check the baud rate( 115200) and see if the commands from STM32 are correct. Please share the connection (Schematic) between STM32 and IMM101T and can you please log the data on the UART TX and RX line ( Between STM32 and IMM101T) and share the log with us. 

if users want to use the device programming command. It will happen in MCE mode. If the user wants to control the motor. it will happen in user UART mode.

Can you confirm am I right?

Yes, to program the firmware and parameters we should be in MCE UART mode and to control the motor we should be in USER UART mode.

Is it possible to use all types of commands in the User UART mode? If not, then how to change MCE to user UART mode and vice versa, using the stm32 project? 

You can use only USER UART commands. Please refer to section 2.3 User Mode UART in Software Reference Manual

Once you are able to establish programming communication between STM32 and IMM. Using STM32 you have to program the iMotion device with the new parameter file  with  InterfaceConf0  = 1 ( USER UART) for changing to USER UART mode.

 

Thanks,

Krupashankar

0 Likes
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @MathanRaja,

Static parameters can be modified only using MCE Wizard. 

 

Thanks,

Krupashankar

0 Likes