eLua in Uart DaisyChain

classic Classic list List threaded Threaded
5 messages Options
Andreas Andreas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

eLua in Uart DaisyChain

Hi everyone,
I have eLua on the STM32f4Discovery. Now I want to make an UART Daisy-Chain with the STM's.
My question is, where can I hook in the Serial Interface (sercon) of lua to manipulate the messages sent over UART.
I'd need to add an adress which STM is meant but remove it before it reaches the eLua Shell or lua-interpreter.
I'd be very happy if you could direct me to the position where I could add my own communication protocol.

Thank you in advance.
raman raman
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: eLua in Uart DaisyChain


Dear Andreas, greetings!

> I have eLua on the STM32f4Discovery. Now I want to make an UART
> Daisy-Chain with the STM's.  My question is, where can I hook in the
> Serial Interface (sercon) of lua to manipulate the messages sent

`sercon' is used to configure the UART channel (channel number) you
want to use to interact with the eLua shell (generally set to 0 on
multiple eLua targets). Normally, your platform abstraction layer must
take care of handling multiple UART channels.

> over UART.  I'd need to add an adress which STM is meant but remove
> it before it reaches the eLua Shell or lua-interpreter.  I'd be very
> happy if you could direct me to the position where I could add my
> own communication protocol.

To process information from UART in eLua, you'll need to touch the
eLua API anyway.  But if you want to do something without talking to
the shell, you may rely on the platform abstraction layer of UART
(src/platform/stm32/platform.c) and write additional code in
src/main.c before the eLua shell can start.

But I'm not sure I understand your requirement clearly. Can you please
elucidate on that a bit more? May I also ask the type of information
you're transmitting? I was wondering is SPI comm is an option for you.

R

On 4 May 2017 at 17:49, Andreas [via eLua Development] <[hidden email]> wrote:
Hi everyone,
I have eLua on the STM32f4Discovery. Now I want to make an UART Daisy-Chain with the STM's.
My question is, where can I hook in the Serial Interface (sercon) of lua to manipulate the messages sent over UART.
I'd need to add an adress which STM is meant but remove it before it reaches the eLua Shell or lua-interpreter.
I'd be very happy if you could direct me to the position where I could add my own communication protocol.

Thank you in advance.


If you reply to this email, your message will be added to the discussion below:
http://elua-development.2368040.n2.nabble.com/eLua-in-Uart-DaisyChain-tp7578604.html
To start a new topic under eLua Development, email [hidden email]
To unsubscribe from eLua Development, click here.
NAML

Andreas Andreas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: eLua in Uart DaisyChain

Hi raman,
what I'm trying to do is chaining multiple STM32F4 Boards in a row connected with UART

Board1 UART4 out -> UART1 IN Board 2 UART 4 OUT -> UART1 IN Board3 UART4 out ...etc.

Every Board forwards incoming Data from UART1 to UART4.
Now I want to change the shell of eLua, so that, when I add an Adress to a Message on the UART, I can talk to one the Boards.

In plain old C Code I got that communication already implemented, but now I want to add eLua on top of it.

Which IDE do you use to test and debug your Code?
raman raman
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: eLua in Uart DaisyChain


Dear Andreas, greetings!

Firstly, I'm sorry for the delay in my response. I have been away for
a while. I really hope this email helps you.

> what I'm trying to do is chaining multiple STM32F4 Boards in a row
> connected with UART

OK. Understand.

> Board1 UART4 out -> UART1 IN Board 2 UART 4 OUT -> UART1 IN Board3
> UART4 out ...etc.

OK. So, can I assume you're running eLua on all the boards?

> Every Board forwards incoming Data from UART1 to UART4.  Now I want
> to change the shell of eLua, so that, when I add an Adress to a
> Message on the UART, I can talk to one the Boards.

Why the shell? The shell is just an interface to invoke `lua' (and
other handy commands). OR perhaps, by "talk to the boards", you mean
you want to talk n'th board's shell from the (n - 1)'th board?

> In plain old C Code I got that communication already implemented,
> but now I want to add eLua on top of it.

I am just going to abstract your problem for a moment. Since you tell
me that you already have your C code that does the UART magic for you,
why don't you write a personal eLua module for yourself? With that,
you can access your C code from the Lua running on your boards. Would
that help you?

If that's what you're looking for, why don't you quickly try [1]?
You'll have to do a bit more than what is described in [1] to get
things to work if you're using the latest version of eLua. Which
version of eLua are you using?

> Which IDE do you use to test and debug your Code?

GNU Emacs works well for me. Sometimes, Eclipse.

R
raman raman
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: eLua in Uart DaisyChain


Sorry, I forgot to include the reference to [1].

R

References:
[1]: http://wiki.eluaproject.net/Tutorials/cmodules
Loading...