custom board for smart serial interface?

More
02 May 2018 04:45 - 02 May 2018 04:47 #109997 by nghung270192
Hello everybody,

I have been researching LBP for 3 days, but i haven't been knowing frameworks which are communicated between master and slave. Does anyone know it?
Thank all.
Last edit: 02 May 2018 04:47 by nghung270192.

Please Log in or Create an account to join the conversation.

More
02 May 2018 09:37 #110007 by fupeama

Hello everybody,

I have been researching LBP for 3 days, but i haven't been knowing frameworks which are communicated between master and slave. Does anyone know it?
Thank all.


Hi,
here is part of my very simple project on sserial.
only for imagination, I am not programer and this is my first program on stm32. I use logic analyzer for listening communication between 7i76e and 7i73 and write this :)
I use only IRQ for RX not empty on UART.
there are lots of ballast information for tuning.
documentation in 7i73 or another pdfs is old, there are missing many info about protocol and new versions are different
look at STMBL. it is complex project.
Martin

File Attachment:

File Name: sserial.c
File Size:17 KB

File Attachment:

File Name: sserial.h
File Size:1 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
21 May 2018 02:30 #110942 by nghung270192
Hi everyone

I have been implemented SSerial protocol between 7i74 and my card.

I have a problem, when the connection is established, Master send to my card one frame, it is "0xDF 0x16".
I think that the first byte is LBPCookieCMD and the second byte is CRC.
After that, Slave send to master a response frame, it is "0x5A 0xA5", the first byte is LBPCookie and the second byte is CRC.
However, This process occur 38 times and nothing happens anymore. I dont know where I am wrong.

Can you help me, please. If you need any further information, I will give you.


Many thanks.

Please Log in or Create an account to join the conversation.

More
21 May 2018 08:46 #110951 by andypugh
Have you looked at the STMBL smart-serial? That uses STM32 too, and already works.

github.com/rene-dev/stmbl/blob/master/src/comps/sserial.c

Please Log in or Create an account to join the conversation.

More
01 Jun 2018 07:55 #111382 by SyNguyen
Hi Andypugh,

I saw your code, I also use it for my project to connect PCI card with my board. Currently, PCI know my board use Sserial protocol. But I start to run then the error that is
"halcmd: hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.rb3t.1.1 remote error = (8) Remote fault "
appear on terminal. I dont know how to fix it, so dont read or write IO. Can you help me to understand what happened? I'll very appreciate it, Thank you so much!

Please Log in or Create an account to join the conversation.

More
01 Jun 2018 09:09 #111383 by andypugh
Well the good news is that you seem to have communications with the board, and discovery is working.

Remote errors are described here:
github.com/LinuxCNC/linuxcnc/blob/master...mot2/sserial.c#L2235

And then checked by this function here
github.com/LinuxCNC/linuxcnc/blob/master...mot2/sserial.c#L2279
but reading this function in conjunction with the notes above it indicates that the programmer was an idiot.
(The function should only consider bits 24 to 31 when decoding remote faults)

Is there another error report before the "remote error" one?

In any case, the problem is that the remote device (your card) is sending back a status report with bit 8 set.
The following user(s) said Thank You: SyNguyen

Please Log in or Create an account to join the conversation.

More
01 Jun 2018 09:47 #111384 by SyNguyen
Yes, Only have the error "remote error" to appear.
I read the document you have sent and i return txbuf [0] = 0x00 on the process data step but it isn't fixed. :(( what do you think about it? Is it correct?
And I have more some questions. Can you explain it for me?. In your code on the sserial.c file. It have some function which are hal_get_systick_value() and hal_get_systick_reload() and " max_waste_ticks = (1.0 / 2500000.0) * 11.0 * (float)block_bytes / (1.0f / (float)hal_get_systick_freq()) "
The first function "hal_get_systick_value()" i dont know the return value of it is milliseconds or microseconds.
The second function "hal_get_systick_reload() " i dont know it what to do?
The last is the max_waste_ticks have the value that is used what to do?
Can you help me to understand it? Again, thank you so much!

Please Log in or Create an account to join the conversation.

More
01 Jun 2018 10:47 #111385 by andypugh
I don't think you are talking about my code.

I wrote the sserial.c here: github.com/LinuxCNC/linuxcnc/blob/master...a-hostmot2/sserial.c

But I think you are talking about the remote sserial.c here: github.com/rene-dev/stmbl/blob/master/src/comps/sserial.c

Which is by Rene, Nico and Ian. Who you can generally find here: gitter.im/rene-dev/stmbl

Please Log in or Create an account to join the conversation.

More
01 Jun 2018 14:28 #111392 by rene-dev
remote fault probably means you are missing the fault byte, or it is incorrect.

also look at my generator for the structs and data descriptors:
github.com/rene-dev/stmbl/blob/master/tools/gentable.c

hal_get_systick_value is the value of the systick timer
hal_get_systick_freq its frequency
hal_get_systick_reload the reload value
its used for a timeout when waiting for an almost complete transmission.

I also reccomend you use the dma for rx and tx, to offload the CPU, and get better timings. the fpga is very picky on timing.

besides the stmbl that code is used on some custom IO boards and a MPG I made, based on stm32f103. I can probably share that code as well.

Rene
The following user(s) said Thank You: tivoi

Please Log in or Create an account to join the conversation.

More
02 Jun 2018 04:38 #111441 by SyNguyen
Hi Andy,

Thank you so much for your replay. I think you are the author coder of file sserial.c both master and remote, but it's incorrect. :) I'm sorry for my mistake. In my project, I think I have some mistake in remote. Thank you for your news to me, so i can know who the author of source code. I really appreciate it, Once again, thank you for your help, thank you so much!

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.098 seconds
Powered by Kunena Forum