Re: GSoC'18-Introduction

2018-02-25 Thread Russell Haley
On Sun, Feb 25, 2018 at 11:08 PM, Udit agarwal  wrote:
> Hi,
> So, the error turned out to be due to missing dts only, after building the
> scripts again with FDT, both the I2C sample code(Logs:here),
> media01(Logs:here) example worked flawlessly, and thus i was able to read
> sd-card data. What could be my next possible task on libbsd?
> Moreover, I tried building wifi sample app as well, but i have Atheros
> AR9271(Firmware name:  ath9k_htc/htc_9271-1.4.0.fw) wireless card. Following
> sichen's blog posts(here) i tried building support for my wireless card, but
> it looks like FreeBSD itself lacks support for this( as mentioned here )
> Is there any other way, apart from using FreeBSD for generating support for
> my wifi card?

I know you said "apart from using FreeBSD" but there is a good chance
that partial support for your card is lying around in FreeBSD HEAD. If
you're really keen you could go on the freebsd-...@freebsd.org mailing
list and ask. Alternatively you pop onto IRC. Adrian and the other
guys on there are the ones that can help you out.

For What It's Worth,
Russ

> Moreover, regarding libbsd documentation, i am keeping note of every step,
> and will soon update the document(libbsd.txt).
>
> Thanks,
> Udit Agarwal
>
> On Sun, Feb 25, 2018 at 11:15 PM, Russell Haley 
> wrote:
>>
>> Sorry for the top post.
>>
>> Dts file in freebsd tree are here. The Dts files are imported from Linux
>> for compatability.
>>
>> https://svnweb.freebsd.org/base/head/sys/gnu/dts/arm/
>>
>> Russ
>>
>> Sent from my BlackBerry 10 smartphone on the Virgin Mobile network.
>>   Original Message
>> From: Christian Mauderer
>> Sent: Sunday, February 25, 2018 2:32 AM
>> To: Udit agarwal; Users
>> Subject: Re: GSoC'18-Introduction
>>
>> Am 25.02.2018 um 08:41 schrieb Udit agarwal:
>> > Hi,
>> > I did build libbsd for beagleboneBlack and executed selectpollkqueue01
>> > test successfully.(Logs:here
>> > )
>> > However, while trying to access SD card, media01 test failed with an
>> > error "fatal source: 9 (RTEMS_FATAL_SOURCE_EXCEPTION)  " (Logs:here
>> > )
>> > I tried debugging the script, by putting printf statements in various
>> > functions, but it seems like it's failing even before entering
>> > test_main().
>> > Also, is there a better method with which we can debug RTEMS scripts?
>> >
>> > Thanks,
>> > Udit Agarwal
>>
>> Hello Udit,
>>
>> it's great that you can already compile and run some of the libbsd
>> examples.
>>
>>
>> Regarding your problem with the SD card: Note that the BBB BSP uses the
>> flattened device tree (at least the libbsd on BBB does). Therefore you
>> have to load a dtb too. My U-Boot boot lines looks like follows:
>>
>> fatload mmc 0 0x8080 rtems-app.img
>> fatload mmc 0 0x8800 am335x-boneblack.dtb
>> bootm 0x8080 - 0x8800
>>
>> I create a SD-Card image with a script that is based on one that is (or
>> was) contained some time back in the BSP. You can have a look here:
>>
>>
>> https://gitlab.com/c-mauderer/rtems-bbb/blob/master/build/create-sdcardimage.sh
>>
>> The script does a lot of things that are not necessary any more (like
>> copying a U-Boot to the SD card). Basically the necessary points would
>> be to create a image and an uEnv.txt (with the lines from 78 to 83). You
>> can use the dtb file that is provided by a FreeBSD or a Linux for BBB.
>>
>>
>> Regarding debugging the application: I would strongly recommend to use
>> some kind of hardware JTAG debugger. Some Beagle Bone variants have an
>> on-board debugger (I think mainly the older white one). For others you
>> can use hardware debuggers like quite a number of adapters supported by
>> OpenOCD (FlySwatter2, simple FTDI-based ones, ...), Segger J-Link (in
>> your case the EDU version) or whatever you find that can debug the BBB.
>>
>> It may be possible to use the libdebugger as a serial debugger. But I
>> never used it so I'm not sure how well you can debug through the libbsd
>> with it. I'm also not sure whether it works for the BBB. Chris Johns
>> added the ARM support some time back. Maybe he can give you any hints if
>> you want to try libdebugger.
>>
>> Best Regards
>>
>> Christian Mauderer
>>
>> >
>> > On Fri, Feb 23, 2018 at 11:25 PM, Christian Mauderer > > > wrote:
>> >
>> > Am 23.02.2018 um 05:17 schrieb Udit agarwal:
>> > > Hi,
>> > > Thanks for your help mentors,
>> > > Since last time, I have managed to modify and execute hello world
>> > > application on both the platforms, my local machine(Ubuntu 14.04) and
>> > > BeagleBone Black.
>> > > I have attached the screenshots and patch file as proof and  detailed
>> > > logs can be found on these(1
>> > > > > 

Re: GSoC'18-Introduction

2018-02-25 Thread Russell Haley
Sorry for the top post. 

Dts file in freebsd tree are here. The Dts files are imported from Linux for 
compatability. 

https://svnweb.freebsd.org/base/head/sys/gnu/dts/arm/

Russ

Sent from my BlackBerry 10 smartphone on the Virgin Mobile network.
  Original Message  
From: Christian Mauderer
Sent: Sunday, February 25, 2018 2:32 AM
To: Udit agarwal; Users
Subject: Re: GSoC'18-Introduction

Am 25.02.2018 um 08:41 schrieb Udit agarwal:
> Hi,
> I did build libbsd for beagleboneBlack and executed selectpollkqueue01
> test successfully.(Logs:here
> )
> However, while trying to access SD card, media01 test failed with an
> error "fatal source: 9 (RTEMS_FATAL_SOURCE_EXCEPTION)  " (Logs:here
> )
> I tried debugging the script, by putting printf statements in various
> functions, but it seems like it's failing even before entering test_main().
> Also, is there a better method with which we can debug RTEMS scripts?
> 
> Thanks,
> Udit Agarwal

Hello Udit,

it's great that you can already compile and run some of the libbsd examples.


Regarding your problem with the SD card: Note that the BBB BSP uses the
flattened device tree (at least the libbsd on BBB does). Therefore you
have to load a dtb too. My U-Boot boot lines looks like follows:

fatload mmc 0 0x8080 rtems-app.img
fatload mmc 0 0x8800 am335x-boneblack.dtb
bootm 0x8080 - 0x8800

I create a SD-Card image with a script that is based on one that is (or
was) contained some time back in the BSP. You can have a look here:

https://gitlab.com/c-mauderer/rtems-bbb/blob/master/build/create-sdcardimage.sh

The script does a lot of things that are not necessary any more (like
copying a U-Boot to the SD card). Basically the necessary points would
be to create a image and an uEnv.txt (with the lines from 78 to 83). You
can use the dtb file that is provided by a FreeBSD or a Linux for BBB.


Regarding debugging the application: I would strongly recommend to use
some kind of hardware JTAG debugger. Some Beagle Bone variants have an
on-board debugger (I think mainly the older white one). For others you
can use hardware debuggers like quite a number of adapters supported by
OpenOCD (FlySwatter2, simple FTDI-based ones, ...), Segger J-Link (in
your case the EDU version) or whatever you find that can debug the BBB.

It may be possible to use the libdebugger as a serial debugger. But I
never used it so I'm not sure how well you can debug through the libbsd
with it. I'm also not sure whether it works for the BBB. Chris Johns
added the ARM support some time back. Maybe he can give you any hints if
you want to try libdebugger.

Best Regards

Christian Mauderer

> 
> On Fri, Feb 23, 2018 at 11:25 PM, Christian Mauderer  > wrote:
> 
> Am 23.02.2018 um 05:17 schrieb Udit agarwal:
> > Hi,
> > Thanks for your help mentors,
> > Since last time, I have managed to modify and execute hello world
> > application on both the platforms, my local machine(Ubuntu 14.04) and
> > BeagleBone Black.
> > I have attached the screenshots and patch file as proof and  detailed
> > logs can be found on these(1
> >  >
> and 2
> >  >)
> gists.
> > Moreover, I went through all the mentioned projects, and found a few of
> > them(Like extending support for PRU, integration of networking stack
> > ,porting RTEMS on PocketBeagle etc) really interesting and doable
> > withing the given time constraint!
> > So, i thought of starting off by studying a bit about the networking
> > stack, its implementation etc. Please recommend few resources from where
> > i can explore this.
> >
> > Regards,
> > Udit agarwal
> >
> 
> Hello Udit,
> 
> it's great that you already have build and successfully executed the
> example on BBB.
> 
> Regarding the network stack. First of all: Note that there are at least
> three network stacks in RTEMS:
> 
> 1. The "old" one which is integrated into the RTEMS sources. This one
> exists since quite some time in RTEMS. It is a fork of a really old
> version of the FreeBSD network stack and it has been heavily adapted
> during the time. I think there is a manual regarding this stack on the
> docs.rtems.org . It has only IPv4 support.
> 
> 2. The "new" one which lives in it's own libbsd repository. That one is
> a fork of the latest FreeBSD development version. One of the important
> points during the development has been that the sources should be as
> close as possible to the upstream FreeBSD sources. This makes it simpler
> to keep up to the FreeBSD development. This one can IPv4 and IPv6 and
> should be basically 

Re: GSoC'18-Introduction

2018-02-25 Thread Christian Mauderer
Am 25.02.2018 um 08:41 schrieb Udit agarwal:
> Hi,
> I did build libbsd for beagleboneBlack and executed selectpollkqueue01
> test successfully.(Logs:here
> )
> However, while trying to access SD card, media01 test failed with an
> error "fatal source: 9 (RTEMS_FATAL_SOURCE_EXCEPTION)  " (Logs:here
> )
> I tried debugging the script, by putting printf statements in various
> functions, but it seems like it's failing even before entering test_main().
> Also, is there a better method with which we can debug RTEMS scripts?
> 
> Thanks,
> Udit Agarwal

Hello Udit,

it's great that you can already compile and run some of the libbsd examples.


Regarding your problem with the SD card: Note that the BBB BSP uses the
flattened device tree (at least the libbsd on BBB does). Therefore you
have to load a dtb too. My U-Boot boot lines looks like follows:

fatload mmc 0 0x8080 rtems-app.img
fatload mmc 0 0x8800 am335x-boneblack.dtb
bootm 0x8080 - 0x8800

I create a SD-Card image with a script that is based on one that is (or
was) contained some time back in the BSP. You can have a look here:

https://gitlab.com/c-mauderer/rtems-bbb/blob/master/build/create-sdcardimage.sh

The script does a lot of things that are not necessary any more (like
copying a U-Boot to the SD card). Basically the necessary points would
be to create a image and an uEnv.txt (with the lines from 78 to 83). You
can use the dtb file that is provided by a FreeBSD or a Linux for BBB.


Regarding debugging the application: I would strongly recommend to use
some kind of hardware JTAG debugger. Some Beagle Bone variants have an
on-board debugger (I think mainly the older white one). For others you
can use hardware debuggers like quite a number of adapters supported by
OpenOCD (FlySwatter2, simple FTDI-based ones, ...), Segger J-Link (in
your case the EDU version) or whatever you find that can debug the BBB.

It may be possible to use the libdebugger as a serial debugger. But I
never used it so I'm not sure how well you can debug through the libbsd
with it. I'm also not sure whether it works for the BBB. Chris Johns
added the ARM support some time back. Maybe he can give you any hints if
you want to try libdebugger.

Best Regards

Christian Mauderer

> 
> On Fri, Feb 23, 2018 at 11:25 PM, Christian Mauderer  > wrote:
> 
> Am 23.02.2018 um 05:17 schrieb Udit agarwal:
> > Hi,
> > Thanks for your help mentors,
> > Since last time, I have managed to modify and execute hello world
> > application on both the platforms, my local machine(Ubuntu 14.04) and
> > BeagleBone Black.
> > I have attached the screenshots and patch file as proof and  detailed
> > logs can be found on these(1
> >  >
> and 2
> >  >)
> gists.
> > Moreover, I went through all the mentioned projects, and found a few of
> > them(Like extending support for PRU, integration of networking stack
> > ,porting RTEMS on PocketBeagle etc) really interesting and doable
> > withing the given time constraint!
> > So, i thought of starting off by studying a bit about the networking
> > stack, its implementation etc. Please recommend few resources from where
> > i can explore this.
> >
> > Regards,
> > Udit agarwal
> >
> 
> Hello Udit,
> 
> it's great that you already have build and successfully executed the
> example on BBB.
> 
> Regarding the network stack. First of all: Note that there are at least
> three network stacks in RTEMS:
> 
> 1. The "old" one which is integrated into the RTEMS sources. This one
> exists since quite some time in RTEMS. It is a fork of a really old
> version of the FreeBSD network stack and it has been heavily adapted
> during the time. I think there is a manual regarding this stack on the
> docs.rtems.org . It has only IPv4 support.
> 
> 2. The "new" one which lives in it's own libbsd repository. That one is
> a fork of the latest FreeBSD development version. One of the important
> points during the development has been that the sources should be as
> close as possible to the upstream FreeBSD sources. This makes it simpler
> to keep up to the FreeBSD development. This one can IPv4 and IPv6 and
> should be basically able to support everything FreeBSD does. Beneath
> that it also brings in USB and SD-Card support and some other subsystems
> of FreeBSD.
> 
> 3. I'm quite sure that I have seen some posts about the lwIP
>