You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Neilh <ne...@biomonitors.com> on 2017/01/25 20:36:11 UTC

newNewt

Hi

  I'm liking the myNewt direction and thanks for the explanations, wiki and
videos.

I've got a Nxp/Freescale Kinetis custom board with a MK26
(flash1M/ram200k 2*otg) KinetisK  that is similar to MK64F on FRDM-MK64F

I have a FRDM-MK64F board and also an olimex-H407 (same processor as olimex-E407 but no Ethernet).

I have the newt tools brought into an Ubuntu 16.04 and run the sim_blinkey

I was thinking of getting started with trying to bring up the FRDM-K64F,
thought that is marked as untested so far.   It does have the USB/SDA
loader.
myproj\repos\apache-mynewt-core\hw\bsp\frdm-k64f\src  seems to have the
basics.

Alternatively, I could familiarize myself work through the Olimex-E407

My  environment so far has been IDE Freescale Kinetis Design
Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
for blowing the flash.

There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
far.

Any recommendation on getting started with FRDM-K64F?   or should I
start with Olimex

thanks


-- 
Neil Hancock




Re: newNewt

Posted by marko kiiskila <ma...@runtime.io>.
Hi Neil,

These download/debug scripts are board-specific (aka BSP specific), so
for a custom board you can have versions which use the multilink software
to do their thing.
The versions checked in to mynewt repository are all done as shell scripts,
which get their parameters passed in as environment variables. So you
can check what the current scripts do (e.g. read frdm-k64_download.sh),
and then do the same; assuming multilink comes with some command line
tools also.

But, should you still want to use the KinetisStudio, it should be easy
to add build rule for your project which invokes newt to do the build (newt build,
newt create-image), and then uses the KinetisStudio to do the download,
and subsequent debug session.

Hope this helps,
M

> On Jan 31, 2017, at 12:10 PM, Neilh <ne...@biomonitors.com> wrote:
> 
> Marko:
> 
> YES - that worked with slight modification - flashing RED tri-coloured led.
> [~/dkr/myproj]$ /usr/local/bin/pyocd-flashtool -se --address 0x8000 bin/targets/blinky/app/apps/blinky/blinky.img bin
> 
> So next question - sorry -
> for accessing a custom board with PE Microsystems Multlink is that possible. The "SDA USB" port device is a PE software - so not sure what the standards are
> here.
> regards
> 
> Neil Hancock
> 
> On 1/31/2017 11:52 AM, marko kiiskila wrote:
>>> On Jan 31, 2017, at 11:44 AM, Neilh <ne...@biomonitors.com> wrote:
>>> 
>>> Hello Marko
>>> 
>>> Thanks for the tips.
>>> 
>>> That's great that it loads directly through the "SDA USB" - worth documenting as its simple and straightforward like on https://developer.mbed.org/
>>> 
>>> When I plug in FRDM-K64F I get a window pop up with the version and then
>>> 
>>> $ lsusb -d0d28: -v
>>> 
>>> shows three interface descriptors.
>>> 
>>> 
>>> #newt load boot-kinetis- doesn't work but using details, can program ot
>>> 
>>> $/usr/local/bin/pyocd-flashtool -se --address 0 bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin
>>> 
>>> 
>>> $newt run blinky -
>>> 
>>> Loading app image into slot 1
>>> Error: Downloading /workspace/bin/targets/blinky/app/apps/blinky/blinky.img to 0x8000
>>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: /usr/local/bin/pyocd-flashtool: not found
>>> 
>>> 
>>> # doesn't work and no  blinky.img - should there be a blinky.img ? am I missing a step?
>>> 
>>> /usr/local/bin/pyocd-flashtool -se --address 0x8000 bin/targets/blinky/app/apps/blinky/blinky.elf.bin
>>> 
>> 
>> Do the following:
>> 
>> newt build blinky
>> newt create-image blinky 1.2.3.4
>> /usr/local/bin/pyocd-flashtool -se —address 0x8000 bin/targets/blinky/app/apps/blinky.img bin
>> 
>> Note create-image step (creates .img file) and the ‘bin’ argument to pyocd-flashtool.
>> 
>> 
>> 
>> 
> 


Re: newNewt

Posted by Neilh <ne...@biomonitors.com>.
Marko:

YES - that worked with slight modification - flashing RED tri-coloured led.
[~/dkr/myproj]$ /usr/local/bin/pyocd-flashtool -se --address 0x8000 
bin/targets/blinky/app/apps/blinky/blinky.img bin

So next question - sorry -
for accessing a custom board with PE Microsystems Multlink is that 
possible. The "SDA USB" port device is a PE software - so not sure what 
the standards are
here.
regards

Neil Hancock

On 1/31/2017 11:52 AM, marko kiiskila wrote:
>> On Jan 31, 2017, at 11:44 AM, Neilh <ne...@biomonitors.com> wrote:
>>
>> Hello Marko
>>
>> Thanks for the tips.
>>
>> That's great that it loads directly through the "SDA USB" - worth documenting as its simple and straightforward like on https://developer.mbed.org/
>>
>> When I plug in FRDM-K64F I get a window pop up with the version and then
>>
>> $ lsusb -d0d28: -v
>>
>> shows three interface descriptors.
>>
>>
>> #newt load boot-kinetis- doesn't work but using details, can program ot
>>
>> $/usr/local/bin/pyocd-flashtool -se --address 0 bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin
>>
>>
>> $newt run blinky -
>>
>> Loading app image into slot 1
>> Error: Downloading /workspace/bin/targets/blinky/app/apps/blinky/blinky.img to 0x8000
>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: /usr/local/bin/pyocd-flashtool: not found
>>
>>
>> # doesn't work and no  blinky.img - should there be a blinky.img ? am I missing a step?
>>
>> /usr/local/bin/pyocd-flashtool -se --address 0x8000 bin/targets/blinky/app/apps/blinky/blinky.elf.bin
>>
>
> Do the following:
>
> newt build blinky
> newt create-image blinky 1.2.3.4
> /usr/local/bin/pyocd-flashtool -se \u2014address 0x8000 bin/targets/blinky/app/apps/blinky.img bin
>
> Note create-image step (creates .img file) and the \u2018bin\u2019 argument to pyocd-flashtool.
>
>
>
>


Re: newNewt

Posted by marko kiiskila <ma...@runtime.io>.
> On Jan 31, 2017, at 11:44 AM, Neilh <ne...@biomonitors.com> wrote:
> 
> Hello Marko
> 
> Thanks for the tips.
> 
> That's great that it loads directly through the "SDA USB" - worth documenting as its simple and straightforward like on https://developer.mbed.org/
> 
> When I plug in FRDM-K64F I get a window pop up with the version and then
> 
> $ lsusb -d0d28: -v
> 
> shows three interface descriptors.
> 
> 
> #newt load boot-kinetis- doesn't work but using details, can program ot
> 
> $/usr/local/bin/pyocd-flashtool -se --address 0 bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin
> 
> 
> $newt run blinky -
> 
> Loading app image into slot 1
> Error: Downloading /workspace/bin/targets/blinky/app/apps/blinky/blinky.img to 0x8000
> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: /usr/local/bin/pyocd-flashtool: not found
> 
> 
> # doesn't work and no  blinky.img - should there be a blinky.img ? am I missing a step?
> 
> /usr/local/bin/pyocd-flashtool -se --address 0x8000 bin/targets/blinky/app/apps/blinky/blinky.elf.bin
> 


Do the following:

newt build blinky
newt create-image blinky 1.2.3.4
/usr/local/bin/pyocd-flashtool -se —address 0x8000 bin/targets/blinky/app/apps/blinky.img bin

Note create-image step (creates .img file) and the ‘bin’ argument to pyocd-flashtool.



Re: newNewt

Posted by Neilh <ne...@biomonitors.com>.
Hello Marko

Thanks for the tips.

That's great that it loads directly through the "SDA USB" - worth 
documenting as its simple and straightforward like on 
https://developer.mbed.org/

When I plug in FRDM-K64F I get a window pop up with the version and then

$ lsusb -d0d28: -v

shows three interface descriptors.


#newt load boot-kinetis- doesn't work but using details, can program ot

$/usr/local/bin/pyocd-flashtool -se --address 0 
bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin


$newt run blinky -

Loading app image into slot 1
Error: Downloading 
/workspace/bin/targets/blinky/app/apps/blinky/blinky.img to 0x8000
/workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 
41: 
/workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 
/usr/local/bin/pyocd-flashtool: not found


# doesn't work and no  blinky.img - should there be a blinky.img ? am I 
missing a step?

/usr/local/bin/pyocd-flashtool -se --address 0x8000 
bin/targets/blinky/app/apps/blinky/blinky.elf.bin


So the programming appears to take, but then nothing - at least no 
flashing led - so I'll dig into the code and try the slinky to see if

> [~/dkr/myproj]$ /usr/local/bin/pyocd-flashtool -se --address  0x8000 
> bin/targets/blinky/app/apps/blinky/blinky.elf.bin
> INFO:root:DAP SWD MODE initialised
> INFO:root:K64F not in secure state
> INFO:root:ROM table #0 @ 0xe00ff000 cidr=b105100d pidr=4000bb4c4
> INFO:root:[0]<e000e000:SCS-M4 cidr=b105e00d, pidr=4000bb00c, class=14>
> WARNING:root:Invalid coresight component, cidr=0x0
> INFO:root:[1]<e0001000: cidr=0, pidr=0, component invalid>
> INFO:root:[2]<e0002000:FPB cidr=b105e00d, pidr=4002bb003, class=14>
> WARNING:root:Invalid coresight component, cidr=0x1010101
> INFO:root:[3]<e0000000: cidr=1010101, pidr=101010101010101, component 
> invalid>
> WARNING:root:Invalid coresight component, cidr=0x0
> INFO:root:[4]<e0040000: cidr=0, pidr=0, component invalid>
> INFO:root:[5]<e0041000:ETM-M4 cidr=b105900d, pidr=4000bb925, class=9, 
> devtype=13, devid=0>
> INFO:root:[6]<e0042000:ETB cidr=b105900d, pidr=4003bb907, class=9, 
> devtype=21, devid=0>
> INFO:root:[7]<e0043000:CSTF cidr=b105900d, pidr=4001bb908, class=9, 
> devtype=12, devid=28>
> INFO:root:CPU core is Cortex-M4
> INFO:root:FPU present
> INFO:root:6 hardware breakpoints, 4 literal comparators
> INFO:root:4 hardware watchpoints
> [====================] 100%
> INFO:root:Programmed 24576 bytes (6 pages) at 11.61 kB/s

Neil

On 1/30/2017 5:34 PM, marko kiiskila wrote:
> I hooked up this board today; there are some rough edges here.
>
> FRDM-K64 download/debug scripts don\u2019t expect multilink JTAG. They
> use the integrated JTAG on the board.
> \u2018newt load\u2019, \u2018newt debug\u2019 and \u2018newt run\u2019 invoke those scripts.
>
> If you use those, you only need micro-USB connected to the port marked with
> \u2018SDA USB\u2019. pyocd should find that target there.
>
> There\u2019s links to help for building/debugging our stuff under eclipse on our
> mailing list, if you want to continue using KinetisDesignStudio.
>
>> On Jan 28, 2017, at 10:31 AM, Neilh <ne...@biomonitors.com> wrote:
>>
>> Thanks.
>>
>> I'm trying to understand the way it works including docker. There seems to be some comment on the internet that docker gets in the way, only supports one process, (so anything spawning a process isn't going to work  ?) - so I started down that route as it seems to be the easiest way - but I really don't want to have to know anything about docker so maybe I need to install it native. Docker also seems to have made the machine soggy.
>>
>> I have the jtag/multitech working through KinetisDesignStudio3.1 (eclipse mars I think)  for another board. Maybe I will try the FRDM-K64 -Which has  a label SCH-28163 Rev D1 over KDS3.1, and then possibly create a project under KDS3.1 for
>>
>> Oh yes blinky v slinky - thanks for the pointers.
>>
>> But have a good weeked, not urgent :)
>> Cheers
>>
>> Neil Hancock
>>
>> On 1/27/2017 3:42 PM, marko kiiskila wrote:
>>> Hi,
>>>
>>>
>>>> On Jan 27, 2017, at 1:39 PM, Neilh <neilh20@biomonitors.com <ma...@biomonitors.com>> wrote:
>>>>
>>>> Hello Marko
>>>>
>>>> Thanks for the suggestion. I was surprised as well, which is why I thought I'd send it out.
>>>>
>>>> Still doesn't work with the hardcoded address via newt:
>>>>
>>>> [~/dkr/myproj]$ newt load boot_kinetis
>>>> Loading bootloader
>>>> Error: Downloading /workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
>>>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: /usr/local/bin/pyocd-flashtool: not found
>>> I have not used docker, but I hear it\u2019s a similar concept to Solaris Zones, FreeBSD prisons.
>>> So what I\u2019m guessing is going on is that the pyocd-flashtool/pyocd binaries are
>>> not inside the docker container. I assume docker does chroot() to somewhere.
>>> Meaning; it\u2019s possible that it has a different set of binaries than your host machine.
>>>
>>> Try adding \u2018set -x\u2019 at the top of the download script, and issue \u2018ls /usr/local/bin\u2019 from
>>> there as well. Then, if you execute newt -lDEBUG load <target>\u2019 you should see
>>> all that output. This should show what the docker container has inside it\u2019s /usr/local/bin.
>>>
>>> So if you can open up a shell inside docker somehow, you might be able to install
>>> that pyocd JTAG software yourself.
>>>
>>> I so far have only used native setups. Therefore I\u2019m a bit hazy on the docker details.
>>>
>>> I was going add openocd option to Kinetis, as I\u2019m used to that as my jtag server.
>>> I have not actually used this BSP myself. I just helped the folks who did the
>>> work to support the MCU. Nor have I used pyocd ever before.
>>>
>>> I do have one or 2 of these at the office (I\u2019m WFH today), so I can get to this
>>> on Monday. I have been meaning to try this out anyway, so this is a good trigger :)
>>>
>>>
>>>> When I use the direct command, with multilink JTAG/USB plugged into FRDM-K64 with J11/cut,   - it can't find the board, or is it the JTAG device
>>>>
>>>> [~/dkr/myproj]$ /usr/local/bin/pyocd-flashtool -se --address 0 bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin
>>>> No connected boards
>>>> Error: There is no board connected.
>>> Hmmm. I want to make sure that you\u2019re using correct USB port. Although, if you\u2019ve
>>> already programmed it Kinetis IDE, then you should be using the right stuff.
>>> Which version of their board do you have?
>>> http://www.nxp.com/products/software-and-tools/hardware-development-tools/freedom-development-boards/freedom-development-platform-for-kinetis-k64-k63-and-k24-mcus:FRDM-K64F?tab=Design_Tools_Tab
>>> that lists 4 different schematics for this.
>>>
>>>> So I'm hunting around for JTAG line command interface hints, usually I use this through KinetisDesignStudio3 -so cmd line jtag is unfamiliar
>>>>
>>>>
>>>> so my objective is to get blinky running so I now I have control.
>>>>
>>>> Is there a way to drop the .bins on the FRDM-K64 USB/SDA - usually through the USB/SDA it only programs a single .bin - so is there a method to programming the boot first and then the Blinky
>>> You should be able to create a file with the whole flash contents on it. Check out the
>>> \u2018manufacturing image\u2019 stuff with newt. But I think we should get the download/debug
>>> scripts to work without. Otherwise debugging things will be very painful.
>>>
>>>> Also, I can't figure out with the boot as to whether it will be detectable on a UART. Where do I see what UART is set to the console.?
>>> Looks like this BSP has them defined in it\u2019s syscfg.yml file. I figured this out
>>> by looking at the hal uart driver for this MCU.
>>> So check hw/bsp/frdm-k64f/syscfg.yml
>>>
>>> Blinky does not open console, BTW. It\u2019s just blinking LEDs. To get console/shell,
>>> you should use slinky (these app names are quite something).
>>>
>>>> thanks
>>>>
>>>>
>>>>
>>>> Neil Hancock
>>>>
>>>> On 1/26/2017 8:56 PM, marko kiiskila wrote:
>>>>> Try running pyocd-flashtool manually with the arguments newt would pass to it.
>>>>> If that works, then at least you have the jtag communications working ok. Or just
>>>>> try changing the download script to use absolute path.
>>>>>
>>>>> Obviously the shell running trying to execute pyocd-flashtool does not have
>>>>> the /usr/local/bin in it\u2019s path. I\u2019m not sure where it picks it\u2019s environment
>>>>> variables from. I\u2019m a bit surprised that /usr/local/bin is not in the path,
>>>>> as that\u2019s where I\u2019d expect openocd to be at (i.e. for other boards).
>>>>>
>>>>>> On Jan 26, 2017, at 6:19 PM, Neilh <neilh20@biomonitors.com <ma...@biomonitors.com>> wrote:
>>>>>>
>>>>>> Thanks for the tips.
>>>>>>
>>>>>> I had followed the docker install and then olimex instructions and subsituted _kinetis
>>>>>>
>>>>>> So I have the FRDM-K64F connected with a multlink JTAG/USB/Ubuntu, and the J11 cut for SWD operation
>>>>>> I also found i needed to add
>>>>>>
>>>>>> sudo -Hpip install --pre -U pyocd
>>>>>>
>>>>>> which added
>>>>>>
>>>>>> /usr/local/bin/pyocd-flashtool
>>>>>> /usr/local/bin/pyocd-gdbserver
>>>>>> /usr/local/bin/pyocd-tool
>>>>>> /usr/local/lib/python2.7/dist-packages/pyOCD
>>>>>>
>>>>>>
>>>>>>
>>>>>> [~/dkr/myproj]$ newt load boot_kinetis
>>>>>>
>>>>>> Loading bootloader
>>>>>> Error: Downloading /workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
>>>>>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh:pyocd-flashtool: not found
>>>>>>
>>>>>> But I have pyocd-flashtool
>>>>>>
>>>>>> [~/dkr/myproj]$ whereis pyocd-flashtool
>>>>>> pyocd-flashtool: /usr/local/bin/pyocd-flashtool
>>>>>>
>>>>>> Any suggestions? is this a docker issue?
>>>>>> thanks
>>>>>>
>>>>>>
>>>>>> Neil Hancock
>>>>>>
>>>>>> On 1/26/2017 9:32 AM, Christopher Collins wrote:
>>>>>>> Sorry, there's something else I forgot to mention.  You'll need to put
>>>>>>> the boot loader on your board as well.  You can do this before or after
>>>>>>> uploading blinky.
>>>>>>>
>>>>>>>     newt target create boot-frdm-k64f &&
>>>>>>>     newt target set boot-frdm-k64f app=@apache-mynewt-core/apps/boot        \
>>>>>>>                                    bsp=@apache-mynewt-core/hw/bsp/frdm-k64f \
>>>>>>>                                    build_profile=optimized
>>>>>>>
>>>>>>> Then build and upload the boot loader to your board:
>>>>>>>
>>>>>>>     newt build boot-frdm-k64f
>>>>>>>     newt load boot-frdm-k64f
>>>>>>>
>>>>>>> Chris
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Jan 26, 2017 at 09:14:02AM -0800, Christopher Collins wrote:
>>>>>>>> To start with, I would create a blinky-frdm-k64f target:
>>>>>>>>
>>>>>>>>     newt target copy my_blinky_sim blinky-frdm-k64f
>>>>>>>>
>>>>>>>> Then configure your new target to use the frdm-k64f BSP:
>>>>>>>>
>>>>>>>>     newt target set blinky-frdm-k64f bsp=@apache-mynewt-core/hw/bsp/frdm-k64f
>>>>>>>>
>>>>>>>> Plug your board in and attach a debugger if necessary, and try running
>>>>>>>> blinky on your board:
>>>>>>>>
>>>>>>>>     newt run blinky-frdm-k64f
>>>>>>>>
>>>>>>>> If everything works, a gdb window will come up.  Type c <enter>, and
>>>>>>>> check if your board's LED is blinking.
>>>>>>>>
>>>>>>>> After you have blinky working on your board, you might want to try one
>>>>>>>> of these other sample apps:
>>>>>>>>     slinky: Includes shell over UART and newtmgr over shell.
>>>>>>>>     bleprph: Includes BLE stack and newtmgr over BLE.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Chris
>>>>>>>>
>>>>>>>>> Alternatively, I could familiarize myself work through the Olimex-E407
>>>>>>>>>
>>>>>>>>> My  environment so far has been IDE Freescale Kinetis Design
>>>>>>>>> Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
>>>>>>>>> for blowing the flash.
>>>>>>>>>
>>>>>>>>> There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
>>>>>>>>> far.
>>>>>>>>>
>>>>>>>>> Any recommendation on getting started with FRDM-K64F?   or should I
>>>>>>>>> start with Olimex
>>>>>>>>>
>>>>>>>>> thanks
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> -- 
>>>>>>>>> Neil Hancock
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>
>
>


Re: newNewt

Posted by marko kiiskila <ma...@runtime.io>.
I hooked up this board today; there are some rough edges here.

FRDM-K64 download/debug scripts don’t expect multilink JTAG. They
use the integrated JTAG on the board.
‘newt load’, ‘newt debug’ and ‘newt run’ invoke those scripts.

If you use those, you only need micro-USB connected to the port marked with
‘SDA USB’. pyocd should find that target there.

There’s links to help for building/debugging our stuff under eclipse on our
mailing list, if you want to continue using KinetisDesignStudio.

> On Jan 28, 2017, at 10:31 AM, Neilh <ne...@biomonitors.com> wrote:
> 
> Thanks.
> 
> I'm trying to understand the way it works including docker. There seems to be some comment on the internet that docker gets in the way, only supports one process, (so anything spawning a process isn't going to work  ?) - so I started down that route as it seems to be the easiest way - but I really don't want to have to know anything about docker so maybe I need to install it native. Docker also seems to have made the machine soggy.
> 
> I have the jtag/multitech working through KinetisDesignStudio3.1 (eclipse mars I think)  for another board. Maybe I will try the FRDM-K64 -Which has  a label SCH-28163 Rev D1 over KDS3.1, and then possibly create a project under KDS3.1 for
> 
> Oh yes blinky v slinky - thanks for the pointers.
> 
> But have a good weeked, not urgent :)
> Cheers
> 
> Neil Hancock
> 
> On 1/27/2017 3:42 PM, marko kiiskila wrote:
>> Hi,
>> 
>> 
>>> On Jan 27, 2017, at 1:39 PM, Neilh <neilh20@biomonitors.com <ma...@biomonitors.com>> wrote:
>>> 
>>> Hello Marko
>>> 
>>> Thanks for the suggestion. I was surprised as well, which is why I thought I'd send it out.
>>> 
>>> Still doesn't work with the hardcoded address via newt:
>>> 
>>> [~/dkr/myproj]$ newt load boot_kinetis
>>> Loading bootloader
>>> Error: Downloading /workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
>>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: /usr/local/bin/pyocd-flashtool: not found
>> 
>> I have not used docker, but I hear it’s a similar concept to Solaris Zones, FreeBSD prisons.
>> So what I’m guessing is going on is that the pyocd-flashtool/pyocd binaries are
>> not inside the docker container. I assume docker does chroot() to somewhere.
>> Meaning; it’s possible that it has a different set of binaries than your host machine.
>> 
>> Try adding ‘set -x’ at the top of the download script, and issue ‘ls /usr/local/bin’ from
>> there as well. Then, if you execute newt -lDEBUG load <target>’ you should see
>> all that output. This should show what the docker container has inside it’s /usr/local/bin.
>> 
>> So if you can open up a shell inside docker somehow, you might be able to install
>> that pyocd JTAG software yourself.
>> 
>> I so far have only used native setups. Therefore I’m a bit hazy on the docker details.
>> 
>> I was going add openocd option to Kinetis, as I’m used to that as my jtag server.
>> I have not actually used this BSP myself. I just helped the folks who did the
>> work to support the MCU. Nor have I used pyocd ever before.
>> 
>> I do have one or 2 of these at the office (I’m WFH today), so I can get to this
>> on Monday. I have been meaning to try this out anyway, so this is a good trigger :)
>> 
>> 
>>> When I use the direct command, with multilink JTAG/USB plugged into FRDM-K64 with J11/cut,   - it can't find the board, or is it the JTAG device
>>> 
>>> [~/dkr/myproj]$ /usr/local/bin/pyocd-flashtool -se --address 0 bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin
>>> No connected boards
>>> Error: There is no board connected.
>> 
>> Hmmm. I want to make sure that you’re using correct USB port. Although, if you’ve
>> already programmed it Kinetis IDE, then you should be using the right stuff.
>> Which version of their board do you have?
>> http://www.nxp.com/products/software-and-tools/hardware-development-tools/freedom-development-boards/freedom-development-platform-for-kinetis-k64-k63-and-k24-mcus:FRDM-K64F?tab=Design_Tools_Tab
>> that lists 4 different schematics for this.
>> 
>>> 
>>> So I'm hunting around for JTAG line command interface hints, usually I use this through KinetisDesignStudio3 -so cmd line jtag is unfamiliar
>>> 
>>> 
>>> so my objective is to get blinky running so I now I have control.
>>> 
>>> Is there a way to drop the .bins on the FRDM-K64 USB/SDA - usually through the USB/SDA it only programs a single .bin - so is there a method to programming the boot first and then the Blinky
>> 
>> You should be able to create a file with the whole flash contents on it. Check out the
>> ‘manufacturing image’ stuff with newt. But I think we should get the download/debug
>> scripts to work without. Otherwise debugging things will be very painful.
>> 
>>> 
>>> Also, I can't figure out with the boot as to whether it will be detectable on a UART. Where do I see what UART is set to the console.?
>> 
>> Looks like this BSP has them defined in it’s syscfg.yml file. I figured this out
>> by looking at the hal uart driver for this MCU.
>> So check hw/bsp/frdm-k64f/syscfg.yml
>> 
>> Blinky does not open console, BTW. It’s just blinking LEDs. To get console/shell,
>> you should use slinky (these app names are quite something).
>> 
>>> thanks
>>> 
>>> 
>>> 
>>> Neil Hancock
>>> 
>>> On 1/26/2017 8:56 PM, marko kiiskila wrote:
>>>> Try running pyocd-flashtool manually with the arguments newt would pass to it.
>>>> If that works, then at least you have the jtag communications working ok. Or just
>>>> try changing the download script to use absolute path.
>>>> 
>>>> Obviously the shell running trying to execute pyocd-flashtool does not have
>>>> the /usr/local/bin in it’s path. I’m not sure where it picks it’s environment
>>>> variables from. I’m a bit surprised that /usr/local/bin is not in the path,
>>>> as that’s where I’d expect openocd to be at (i.e. for other boards).
>>>> 
>>>>> On Jan 26, 2017, at 6:19 PM, Neilh <neilh20@biomonitors.com <ma...@biomonitors.com>> wrote:
>>>>> 
>>>>> Thanks for the tips.
>>>>> 
>>>>> I had followed the docker install and then olimex instructions and subsituted _kinetis
>>>>> 
>>>>> So I have the FRDM-K64F connected with a multlink JTAG/USB/Ubuntu, and the J11 cut for SWD operation
>>>>> I also found i needed to add
>>>>> 
>>>>> sudo -Hpip install --pre -U pyocd
>>>>> 
>>>>> which added
>>>>> 
>>>>> /usr/local/bin/pyocd-flashtool
>>>>> /usr/local/bin/pyocd-gdbserver
>>>>> /usr/local/bin/pyocd-tool
>>>>> /usr/local/lib/python2.7/dist-packages/pyOCD
>>>>> 
>>>>> 
>>>>> 
>>>>> [~/dkr/myproj]$ newt load boot_kinetis
>>>>> 
>>>>> Loading bootloader
>>>>> Error: Downloading /workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
>>>>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh:pyocd-flashtool: not found
>>>>> 
>>>>> But I have pyocd-flashtool
>>>>> 
>>>>> [~/dkr/myproj]$ whereis pyocd-flashtool
>>>>> pyocd-flashtool: /usr/local/bin/pyocd-flashtool
>>>>> 
>>>>> Any suggestions? is this a docker issue?
>>>>> thanks
>>>>> 
>>>>> 
>>>>> Neil Hancock
>>>>> 
>>>>> On 1/26/2017 9:32 AM, Christopher Collins wrote:
>>>>>> Sorry, there's something else I forgot to mention.  You'll need to put
>>>>>> the boot loader on your board as well.  You can do this before or after
>>>>>> uploading blinky.
>>>>>> 
>>>>>>    newt target create boot-frdm-k64f &&
>>>>>>    newt target set boot-frdm-k64f app=@apache-mynewt-core/apps/boot        \
>>>>>>                                   bsp=@apache-mynewt-core/hw/bsp/frdm-k64f \
>>>>>>                                   build_profile=optimized
>>>>>> 
>>>>>> Then build and upload the boot loader to your board:
>>>>>> 
>>>>>>    newt build boot-frdm-k64f
>>>>>>    newt load boot-frdm-k64f
>>>>>> 
>>>>>> Chris
>>>>>> 
>>>>>> 
>>>>>> On Thu, Jan 26, 2017 at 09:14:02AM -0800, Christopher Collins wrote:
>>>>>>> To start with, I would create a blinky-frdm-k64f target:
>>>>>>> 
>>>>>>>    newt target copy my_blinky_sim blinky-frdm-k64f
>>>>>>> 
>>>>>>> Then configure your new target to use the frdm-k64f BSP:
>>>>>>> 
>>>>>>>    newt target set blinky-frdm-k64f bsp=@apache-mynewt-core/hw/bsp/frdm-k64f
>>>>>>> 
>>>>>>> Plug your board in and attach a debugger if necessary, and try running
>>>>>>> blinky on your board:
>>>>>>> 
>>>>>>>    newt run blinky-frdm-k64f
>>>>>>> 
>>>>>>> If everything works, a gdb window will come up.  Type c <enter>, and
>>>>>>> check if your board's LED is blinking.
>>>>>>> 
>>>>>>> After you have blinky working on your board, you might want to try one
>>>>>>> of these other sample apps:
>>>>>>>    slinky: Includes shell over UART and newtmgr over shell.
>>>>>>>    bleprph: Includes BLE stack and newtmgr over BLE.
>>>>>>> 
>>>>>>> Thanks,
>>>>>>> Chris
>>>>>>> 
>>>>>>>> Alternatively, I could familiarize myself work through the Olimex-E407
>>>>>>>> 
>>>>>>>> My  environment so far has been IDE Freescale Kinetis Design
>>>>>>>> Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
>>>>>>>> for blowing the flash.
>>>>>>>> 
>>>>>>>> There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
>>>>>>>> far.
>>>>>>>> 
>>>>>>>> Any recommendation on getting started with FRDM-K64F?   or should I
>>>>>>>> start with Olimex
>>>>>>>> 
>>>>>>>> thanks
>>>>>>>> 
>>>>>>>> 
>>>>>>>> -- 
>>>>>>>> Neil Hancock
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>> 
>>>> 
>>> 
>> 
> 


Re: newNewt

Posted by Neilh <ne...@biomonitors.com>.
Thanks.

I'm trying to understand the way it works including docker. There seems 
to be some comment on the internet that docker gets in the way, only 
supports one process, (so anything spawning a process isn't going to 
work  ?) - so I started down that route as it seems to be the easiest 
way - but I really don't want to have to know anything about docker so 
maybe I need to install it native. Docker also seems to have made the 
machine soggy.

I have the jtag/multitech working through KinetisDesignStudio3.1 
(eclipse mars I think)  for another board. Maybe I will try the FRDM-K64 
-Which has  a label SCH-28163 Rev D1 over KDS3.1, and then possibly 
create a project under KDS3.1 for

Oh yes blinky v slinky - thanks for the pointers.

But have a good weeked, not urgent :)
Cheers

Neil Hancock

On 1/27/2017 3:42 PM, marko kiiskila wrote:
> Hi,
>
>
>> On Jan 27, 2017, at 1:39 PM, Neilh <neilh20@biomonitors.com 
>> <ma...@biomonitors.com>> wrote:
>>
>> Hello Marko
>>
>> Thanks for the suggestion. I was surprised as well, which is why I 
>> thought I'd send it out.
>>
>> Still doesn't work with the hardcoded address via newt:
>>
>> [~/dkr/myproj]$ newt load boot_kinetis
>> Loading bootloader
>> Error: Downloading 
>> /workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 
>> 41: 
>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 
>> /usr/local/bin/pyocd-flashtool: not found
>
> I have not used docker, but I hear it\u2019s a similar concept to Solaris 
> Zones, FreeBSD prisons.
> So what I\u2019m guessing is going on is that the pyocd-flashtool/pyocd 
> binaries are
> not inside the docker container. I assume docker does chroot() to 
> somewhere.
> Meaning; it\u2019s possible that it has a different set of binaries than 
> your host machine.
>
> Try adding \u2018set -x\u2019 at the top of the download script, and issue \u2018ls 
> /usr/local/bin\u2019 from
> there as well. Then, if you execute newt -lDEBUG load <target>\u2019 you 
> should see
> all that output. This should show what the docker container has inside 
> it\u2019s /usr/local/bin.
>
> So if you can open up a shell inside docker somehow, you might be able 
> to install
> that pyocd JTAG software yourself.
>
> I so far have only used native setups. Therefore I\u2019m a bit hazy on the 
> docker details.
>
> I was going add openocd option to Kinetis, as I\u2019m used to that as my 
> jtag server.
> I have not actually used this BSP myself. I just helped the folks who 
> did the
> work to support the MCU. Nor have I used pyocd ever before.
>
> I do have one or 2 of these at the office (I\u2019m WFH today), so I can 
> get to this
> on Monday. I have been meaning to try this out anyway, so this is a 
> good trigger :)
>
>
>> When I use the direct command, with multilink JTAG/USB plugged into 
>> FRDM-K64 with J11/cut,   - it can't find the board, or is it the JTAG 
>> device
>>
>> [~/dkr/myproj]$ /usr/local/bin/pyocd-flashtool -se --address 0 
>> bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin
>> No connected boards
>> Error: There is no board connected.
>
> Hmmm. I want to make sure that you\u2019re using correct USB port. 
> Although, if you\u2019ve
> already programmed it Kinetis IDE, then you should be using the right 
> stuff.
> Which version of their board do you have?
> http://www.nxp.com/products/software-and-tools/hardware-development-tools/freedom-development-boards/freedom-development-platform-for-kinetis-k64-k63-and-k24-mcus:FRDM-K64F?tab=Design_Tools_Tab
> that lists 4 different schematics for this.
>
>>
>> So I'm hunting around for JTAG line command interface hints, usually 
>> I use this through KinetisDesignStudio3 -so cmd line jtag is unfamiliar
>>
>>
>> so my objective is to get blinky running so I now I have control.
>>
>> Is there a way to drop the .bins on the FRDM-K64 USB/SDA - usually 
>> through the USB/SDA it only programs a single .bin - so is there a 
>> method to programming the boot first and then the Blinky
>
> You should be able to create a file with the whole flash contents on 
> it. Check out the
> \u2018manufacturing image\u2019 stuff with newt. But I think we should get the 
> download/debug
> scripts to work without. Otherwise debugging things will be very painful.
>
>>
>> Also, I can't figure out with the boot as to whether it will be 
>> detectable on a UART. Where do I see what UART is set to the console.?
>
> Looks like this BSP has them defined in it\u2019s syscfg.yml file. I 
> figured this out
> by looking at the hal uart driver for this MCU.
> So check hw/bsp/frdm-k64f/syscfg.yml
>
> Blinky does not open console, BTW. It\u2019s just blinking LEDs. To get 
> console/shell,
> you should use slinky (these app names are quite something).
>
>> thanks
>>
>>
>>
>> Neil Hancock
>>
>> On 1/26/2017 8:56 PM, marko kiiskila wrote:
>>> Try running pyocd-flashtool manually with the arguments newt would 
>>> pass to it.
>>> If that works, then at least you have the jtag communications 
>>> working ok. Or just
>>> try changing the download script to use absolute path.
>>>
>>> Obviously the shell running trying to execute pyocd-flashtool does 
>>> not have
>>> the /usr/local/bin in it\u2019s path. I\u2019m not sure where it picks it\u2019s 
>>> environment
>>> variables from. I\u2019m a bit surprised that /usr/local/bin is not in 
>>> the path,
>>> as that\u2019s where I\u2019d expect openocd to be at (i.e. for other boards).
>>>
>>>> On Jan 26, 2017, at 6:19 PM, Neilh <neilh20@biomonitors.com 
>>>> <ma...@biomonitors.com>> wrote:
>>>>
>>>> Thanks for the tips.
>>>>
>>>> I had followed the docker install and then olimex instructions and 
>>>> subsituted _kinetis
>>>>
>>>> So I have the FRDM-K64F connected with a multlink JTAG/USB/Ubuntu, 
>>>> and the J11 cut for SWD operation
>>>> I also found i needed to add
>>>>
>>>> sudo -Hpip install --pre -U pyocd
>>>>
>>>> which added
>>>>
>>>>  /usr/local/bin/pyocd-flashtool
>>>>  /usr/local/bin/pyocd-gdbserver
>>>>  /usr/local/bin/pyocd-tool
>>>>  /usr/local/lib/python2.7/dist-packages/pyOCD
>>>>
>>>>
>>>>
>>>> [~/dkr/myproj]$ newt load boot_kinetis
>>>>
>>>> Loading bootloader
>>>> Error: Downloading 
>>>> /workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
>>>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 
>>>> 41: 
>>>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh:pyocd-flashtool: 
>>>> not found
>>>>
>>>> But I have pyocd-flashtool
>>>>
>>>> [~/dkr/myproj]$ whereis pyocd-flashtool
>>>> pyocd-flashtool: /usr/local/bin/pyocd-flashtool
>>>>
>>>> Any suggestions? is this a docker issue?
>>>> thanks
>>>>
>>>>
>>>> Neil Hancock
>>>>
>>>> On 1/26/2017 9:32 AM, Christopher Collins wrote:
>>>>> Sorry, there's something else I forgot to mention.  You'll need to put
>>>>> the boot loader on your board as well.  You can do this before or 
>>>>> after
>>>>> uploading blinky.
>>>>>
>>>>>     newt target create boot-frdm-k64f &&
>>>>>     newt target set boot-frdm-k64f 
>>>>> app=@apache-mynewt-core/apps/boot        \
>>>>>                                    bsp=@apache-mynewt-core/hw/bsp/frdm-k64f 
>>>>> \
>>>>>                                    build_profile=optimized
>>>>>
>>>>> Then build and upload the boot loader to your board:
>>>>>
>>>>>     newt build boot-frdm-k64f
>>>>>     newt load boot-frdm-k64f
>>>>>
>>>>> Chris
>>>>>
>>>>>
>>>>> On Thu, Jan 26, 2017 at 09:14:02AM -0800, Christopher Collins wrote:
>>>>>> To start with, I would create a blinky-frdm-k64f target:
>>>>>>
>>>>>>     newt target copy my_blinky_sim blinky-frdm-k64f
>>>>>>
>>>>>> Then configure your new target to use the frdm-k64f BSP:
>>>>>>
>>>>>>     newt target set blinky-frdm-k64f 
>>>>>> bsp=@apache-mynewt-core/hw/bsp/frdm-k64f
>>>>>>
>>>>>> Plug your board in and attach a debugger if necessary, and try 
>>>>>> running
>>>>>> blinky on your board:
>>>>>>
>>>>>>     newt run blinky-frdm-k64f
>>>>>>
>>>>>> If everything works, a gdb window will come up.  Type c <enter>, and
>>>>>> check if your board's LED is blinking.
>>>>>>
>>>>>> After you have blinky working on your board, you might want to 
>>>>>> try one
>>>>>> of these other sample apps:
>>>>>>     slinky: Includes shell over UART and newtmgr over shell.
>>>>>>     bleprph: Includes BLE stack and newtmgr over BLE.
>>>>>>
>>>>>> Thanks,
>>>>>> Chris
>>>>>>
>>>>>>> Alternatively, I could familiarize myself work through the 
>>>>>>> Olimex-E407
>>>>>>>
>>>>>>> My  environment so far has been IDE Freescale Kinetis Design
>>>>>>> Studio/Eclipse building nuttx OS, and with integration to 
>>>>>>> Multilink JTAG
>>>>>>> for blowing the flash.
>>>>>>>
>>>>>>> There was a new feature request for an Eclipse plugin for 
>>>>>>> myNewt, but it was marked as dup, and I haven't seen any other 
>>>>>>> mention of Eclipse IDE so
>>>>>>> far.
>>>>>>>
>>>>>>> Any recommendation on getting started with FRDM-K64F?   or should I
>>>>>>> start with Olimex
>>>>>>>
>>>>>>> thanks
>>>>>>>
>>>>>>>
>>>>>>> -- 
>>>>>>> Neil Hancock
>>>>>>>
>>>>>>>
>>>>>>>
>>>
>>>
>>
>


Re: newNewt

Posted by Neilh <ne...@biomonitors.com>.
Hello Marko

Thanks for the suggestion. I was surprised as well, which is why I 
thought I'd send it out.

Still doesn't work with the hardcoded address via newt:

[~/dkr/myproj]$ newt load boot_kinetis
Loading bootloader
Error: Downloading 
/workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
/workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 
41: 
/workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 
/usr/local/bin/pyocd-flashtool: not found

When I use the direct command, with multilink JTAG/USB plugged into 
FRDM-K64 with J11/cut,   - it can't find the board, or is it the JTAG 
device

[~/dkr/myproj]$ /usr/local/bin/pyocd-flashtool -se --address 0 
bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin
No connected boards
Error: There is no board connected.


So I'm hunting around for JTAG line command interface hints, usually I 
use this through KinetisDesignStudio3 -so cmd line jtag is unfamiliar


so my objective is to get blinky running so I now I have control.

Is there a way to drop the .bins on the FRDM-K64 USB/SDA - usually 
through the USB/SDA it only programs a single .bin - so is there a 
method to programming the boot first and then the blinky

Also, I can't figure out with the boot as to whether it will be 
detectable on a UART. Where do I see what UART is set to the console.?

thanks



Neil Hancock

On 1/26/2017 8:56 PM, marko kiiskila wrote:
> Try running pyocd-flashtool manually with the arguments newt would pass to it.
> If that works, then at least you have the jtag communications working ok. Or just
> try changing the download script to use absolute path.
>
> Obviously the shell running trying to execute pyocd-flashtool does not have
> the /usr/local/bin in it\u2019s path. I\u2019m not sure where it picks it\u2019s environment
> variables from. I\u2019m a bit surprised that /usr/local/bin is not in the path,
> as that\u2019s where I\u2019d expect openocd to be at (i.e. for other boards).
>
>> On Jan 26, 2017, at 6:19 PM, Neilh <ne...@biomonitors.com> wrote:
>>
>> Thanks for the tips.
>>
>> I had followed the docker install and then olimex instructions and subsituted _kinetis
>>
>> So I have the FRDM-K64F connected with a multlink JTAG/USB/Ubuntu, and the J11 cut for SWD operation
>> I also found i needed to add
>>
>> sudo -Hpip install --pre -U pyocd
>>
>> which added
>>
>>   /usr/local/bin/pyocd-flashtool
>>   /usr/local/bin/pyocd-gdbserver
>>   /usr/local/bin/pyocd-tool
>>   /usr/local/lib/python2.7/dist-packages/pyOCD
>>
>>
>>
>> [~/dkr/myproj]$ newt load boot_kinetis
>>
>> Loading bootloader
>> Error: Downloading /workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
>> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh:pyocd-flashtool: not found
>>
>> But I have pyocd-flashtool
>>
>> [~/dkr/myproj]$ whereis pyocd-flashtool
>> pyocd-flashtool: /usr/local/bin/pyocd-flashtool
>>
>> Any suggestions? is this a docker issue?
>> thanks
>>
>>
>> Neil Hancock
>>
>> On 1/26/2017 9:32 AM, Christopher Collins wrote:
>>> Sorry, there's something else I forgot to mention.  You'll need to put
>>> the boot loader on your board as well.  You can do this before or after
>>> uploading blinky.
>>>
>>>      newt target create boot-frdm-k64f &&
>>>      newt target set boot-frdm-k64f app=@apache-mynewt-core/apps/boot        \
>>>                                     bsp=@apache-mynewt-core/hw/bsp/frdm-k64f \
>>>                                     build_profile=optimized
>>>
>>> Then build and upload the boot loader to your board:
>>>
>>>      newt build boot-frdm-k64f
>>>      newt load boot-frdm-k64f
>>>
>>> Chris
>>>
>>>
>>> On Thu, Jan 26, 2017 at 09:14:02AM -0800, Christopher Collins wrote:
>>>> To start with, I would create a blinky-frdm-k64f target:
>>>>
>>>>      newt target copy my_blinky_sim blinky-frdm-k64f
>>>>
>>>> Then configure your new target to use the frdm-k64f BSP:
>>>>
>>>>      newt target set blinky-frdm-k64f bsp=@apache-mynewt-core/hw/bsp/frdm-k64f
>>>>
>>>> Plug your board in and attach a debugger if necessary, and try running
>>>> blinky on your board:
>>>>
>>>>      newt run blinky-frdm-k64f
>>>>
>>>> If everything works, a gdb window will come up.  Type c <enter>, and
>>>> check if your board's LED is blinking.
>>>>
>>>> After you have blinky working on your board, you might want to try one
>>>> of these other sample apps:
>>>>      slinky: Includes shell over UART and newtmgr over shell.
>>>>      bleprph: Includes BLE stack and newtmgr over BLE.
>>>>
>>>> Thanks,
>>>> Chris
>>>>
>>>>> Alternatively, I could familiarize myself work through the Olimex-E407
>>>>>
>>>>> My  environment so far has been IDE Freescale Kinetis Design
>>>>> Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
>>>>> for blowing the flash.
>>>>>
>>>>> There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
>>>>> far.
>>>>>
>>>>> Any recommendation on getting started with FRDM-K64F?   or should I
>>>>> start with Olimex
>>>>>
>>>>> thanks
>>>>>
>>>>>
>>>>> -- 
>>>>> Neil Hancock
>>>>>
>>>>>
>>>>>
>
>


Re: newNewt

Posted by marko kiiskila <ma...@runtime.io>.
Try running pyocd-flashtool manually with the arguments newt would pass to it.
If that works, then at least you have the jtag communications working ok. Or just
try changing the download script to use absolute path.

Obviously the shell running trying to execute pyocd-flashtool does not have
the /usr/local/bin in it’s path. I’m not sure where it picks it’s environment
variables from. I’m a bit surprised that /usr/local/bin is not in the path,
as that’s where I’d expect openocd to be at (i.e. for other boards).

> On Jan 26, 2017, at 6:19 PM, Neilh <ne...@biomonitors.com> wrote:
> 
> Thanks for the tips.
> 
> I had followed the docker install and then olimex instructions and subsituted _kinetis
> 
> So I have the FRDM-K64F connected with a multlink JTAG/USB/Ubuntu, and the J11 cut for SWD operation
> I also found i needed to add
> 
> sudo -Hpip install --pre -U pyocd
> 
> which added
> 
>  /usr/local/bin/pyocd-flashtool
>  /usr/local/bin/pyocd-gdbserver
>  /usr/local/bin/pyocd-tool
>  /usr/local/lib/python2.7/dist-packages/pyOCD
> 
> 
> 
> [~/dkr/myproj]$ newt load boot_kinetis
> 
> Loading bootloader
> Error: Downloading /workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
> /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 41: /workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh:pyocd-flashtool: not found
> 
> But I have pyocd-flashtool
> 
> [~/dkr/myproj]$ whereis pyocd-flashtool
> pyocd-flashtool: /usr/local/bin/pyocd-flashtool
> 
> Any suggestions? is this a docker issue?
> thanks
> 
> 
> Neil Hancock
> 
> On 1/26/2017 9:32 AM, Christopher Collins wrote:
>> Sorry, there's something else I forgot to mention.  You'll need to put
>> the boot loader on your board as well.  You can do this before or after
>> uploading blinky.
>> 
>>     newt target create boot-frdm-k64f &&
>>     newt target set boot-frdm-k64f app=@apache-mynewt-core/apps/boot        \
>>                                    bsp=@apache-mynewt-core/hw/bsp/frdm-k64f \
>>                                    build_profile=optimized
>> 
>> Then build and upload the boot loader to your board:
>> 
>>     newt build boot-frdm-k64f
>>     newt load boot-frdm-k64f
>> 
>> Chris
>> 
>> 
>> On Thu, Jan 26, 2017 at 09:14:02AM -0800, Christopher Collins wrote:
>>> To start with, I would create a blinky-frdm-k64f target:
>>> 
>>>     newt target copy my_blinky_sim blinky-frdm-k64f
>>> 
>>> Then configure your new target to use the frdm-k64f BSP:
>>> 
>>>     newt target set blinky-frdm-k64f bsp=@apache-mynewt-core/hw/bsp/frdm-k64f
>>> 
>>> Plug your board in and attach a debugger if necessary, and try running
>>> blinky on your board:
>>> 
>>>     newt run blinky-frdm-k64f
>>> 
>>> If everything works, a gdb window will come up.  Type c <enter>, and
>>> check if your board's LED is blinking.
>>> 
>>> After you have blinky working on your board, you might want to try one
>>> of these other sample apps:
>>>     slinky: Includes shell over UART and newtmgr over shell.
>>>     bleprph: Includes BLE stack and newtmgr over BLE.
>>> 
>>> Thanks,
>>> Chris
>>> 
>>>> Alternatively, I could familiarize myself work through the Olimex-E407
>>>> 
>>>> My  environment so far has been IDE Freescale Kinetis Design
>>>> Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
>>>> for blowing the flash.
>>>> 
>>>> There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
>>>> far.
>>>> 
>>>> Any recommendation on getting started with FRDM-K64F?   or should I
>>>> start with Olimex
>>>> 
>>>> thanks
>>>> 
>>>> 
>>>> -- 
>>>> Neil Hancock
>>>> 
>>>> 
>>>> 
>> 
> 


Re: newNewt

Posted by Neilh <ne...@biomonitors.com>.
Thanks for the tips.

I had followed the docker install and then olimex instructions and 
subsituted _kinetis

So I have the FRDM-K64F connected with a multlink JTAG/USB/Ubuntu, and 
the J11 cut for SWD operation
I also found i needed to add

sudo -Hpip install --pre -U pyocd

which added

   /usr/local/bin/pyocd-flashtool
   /usr/local/bin/pyocd-gdbserver
   /usr/local/bin/pyocd-tool
   /usr/local/lib/python2.7/dist-packages/pyOCD



[~/dkr/myproj]$ newt load boot_kinetis

Loading bootloader
Error: Downloading 
/workspace/bin/targets/boot_kinetis/app/apps/boot/boot.elf.bin to 0x0
/workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh: 
41: 
/workspace/repos/apache-mynewt-core/hw/bsp/frdm-k64f/frdm-k64_download.sh:pyocd-flashtool: 
not found

But I have pyocd-flashtool

[~/dkr/myproj]$ whereis pyocd-flashtool
pyocd-flashtool: /usr/local/bin/pyocd-flashtool

Any suggestions? is this a docker issue?
thanks


Neil Hancock

On 1/26/2017 9:32 AM, Christopher Collins wrote:
> Sorry, there's something else I forgot to mention.  You'll need to put
> the boot loader on your board as well.  You can do this before or after
> uploading blinky.
>
>      newt target create boot-frdm-k64f &&
>      newt target set boot-frdm-k64f app=@apache-mynewt-core/apps/boot        \
>                                     bsp=@apache-mynewt-core/hw/bsp/frdm-k64f \
>                                     build_profile=optimized
>
> Then build and upload the boot loader to your board:
>
>      newt build boot-frdm-k64f
>      newt load boot-frdm-k64f
>
> Chris
>
>
> On Thu, Jan 26, 2017 at 09:14:02AM -0800, Christopher Collins wrote:
>> To start with, I would create a blinky-frdm-k64f target:
>>
>>      newt target copy my_blinky_sim blinky-frdm-k64f
>>
>> Then configure your new target to use the frdm-k64f BSP:
>>
>>      newt target set blinky-frdm-k64f bsp=@apache-mynewt-core/hw/bsp/frdm-k64f
>>
>> Plug your board in and attach a debugger if necessary, and try running
>> blinky on your board:
>>
>>      newt run blinky-frdm-k64f
>>
>> If everything works, a gdb window will come up.  Type c <enter>, and
>> check if your board's LED is blinking.
>>
>> After you have blinky working on your board, you might want to try one
>> of these other sample apps:
>>      slinky: Includes shell over UART and newtmgr over shell.
>>      bleprph: Includes BLE stack and newtmgr over BLE.
>>
>> Thanks,
>> Chris
>>
>>> Alternatively, I could familiarize myself work through the Olimex-E407
>>>
>>> My  environment so far has been IDE Freescale Kinetis Design
>>> Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
>>> for blowing the flash.
>>>
>>> There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
>>> far.
>>>
>>> Any recommendation on getting started with FRDM-K64F?   or should I
>>> start with Olimex
>>>
>>> thanks
>>>
>>>
>>> -- 
>>> Neil Hancock
>>>
>>>
>>>
>


Re: newNewt

Posted by Christopher Collins <cc...@apache.org>.
Sorry, there's something else I forgot to mention.  You'll need to put
the boot loader on your board as well.  You can do this before or after
uploading blinky.

    newt target create boot-frdm-k64f &&
    newt target set boot-frdm-k64f app=@apache-mynewt-core/apps/boot        \
                                   bsp=@apache-mynewt-core/hw/bsp/frdm-k64f \
                                   build_profile=optimized

Then build and upload the boot loader to your board:

    newt build boot-frdm-k64f
    newt load boot-frdm-k64f

Chris


On Thu, Jan 26, 2017 at 09:14:02AM -0800, Christopher Collins wrote:
> To start with, I would create a blinky-frdm-k64f target:
> 
>     newt target copy my_blinky_sim blinky-frdm-k64f
> 
> Then configure your new target to use the frdm-k64f BSP:
> 
>     newt target set blinky-frdm-k64f bsp=@apache-mynewt-core/hw/bsp/frdm-k64f
> 
> Plug your board in and attach a debugger if necessary, and try running
> blinky on your board:
> 
>     newt run blinky-frdm-k64f
> 
> If everything works, a gdb window will come up.  Type c <enter>, and
> check if your board's LED is blinking.
> 
> After you have blinky working on your board, you might want to try one
> of these other sample apps:
>     slinky: Includes shell over UART and newtmgr over shell.
>     bleprph: Includes BLE stack and newtmgr over BLE.
> 
> Thanks,
> Chris
> 
> > 
> > Alternatively, I could familiarize myself work through the Olimex-E407
> > 
> > My  environment so far has been IDE Freescale Kinetis Design
> > Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
> > for blowing the flash.
> > 
> > There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
> > far.
> > 
> > Any recommendation on getting started with FRDM-K64F?   or should I
> > start with Olimex
> > 
> > thanks
> > 
> > 
> > -- 
> > Neil Hancock
> > 
> > 
> > 

Re: newNewt

Posted by Christopher Collins <cc...@apache.org>.
On Thu, Jan 26, 2017 at 09:14:02AM -0800, Christopher Collins wrote:
> Plug your board in and attach a debugger if necessary, and try running
> blinky on your board:
> 
>     newt run blinky-frdm-k64f

That should be:

    newt run blinky-frdm-k64f 0

(append a zero!)

Chris

Re: newNewt

Posted by Christopher Collins <cc...@apache.org>.
Hi Neil,

On Wed, Jan 25, 2017 at 12:36:11PM -0800, Neilh wrote:
> Hi
> 
>   I'm liking the myNewt direction and thanks for the explanations, wiki and
> videos.

Great!

> I've got a Nxp/Freescale Kinetis custom board with a MK26
> (flash1M/ram200k 2*otg) KinetisK  that is similar to MK64F on FRDM-MK64F
> 
> I have a FRDM-MK64F board and also an olimex-H407 (same processor as olimex-E407 but no Ethernet).
> 
> I have the newt tools brought into an Ubuntu 16.04 and run the sim_blinkey
> 
> I was thinking of getting started with trying to bring up the FRDM-K64F,
> thought that is marked as untested so far.   It does have the USB/SDA
> loader.
> myproj\repos\apache-mynewt-core\hw\bsp\frdm-k64f\src  seems to have the
> basics.

To start with, I would create a blinky-frdm-k64f target:

    newt target copy my_blinky_sim blinky-frdm-k64f

Then configure your new target to use the frdm-k64f BSP:

    newt target set blinky-frdm-k64f bsp=@apache-mynewt-core/hw/bsp/frdm-k64f

Plug your board in and attach a debugger if necessary, and try running
blinky on your board:

    newt run blinky-frdm-k64f

If everything works, a gdb window will come up.  Type c <enter>, and
check if your board's LED is blinking.

After you have blinky working on your board, you might want to try one
of these other sample apps:
    slinky: Includes shell over UART and newtmgr over shell.
    bleprph: Includes BLE stack and newtmgr over BLE.

Thanks,
Chris

> 
> Alternatively, I could familiarize myself work through the Olimex-E407
> 
> My  environment so far has been IDE Freescale Kinetis Design
> Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
> for blowing the flash.
> 
> There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
> far.
> 
> Any recommendation on getting started with FRDM-K64F?   or should I
> start with Olimex
> 
> thanks
> 
> 
> -- 
> Neil Hancock
> 
> 
> 

Re: newNewt

Posted by Jim Jagielski <ji...@jaguNET.com>.
Oh that is cool!

> On Jan 25, 2017, at 4:45 PM, Sterling Hughes <st...@gmail.com> wrote:
> 
> Hi Neil,
> 
> Sounds like a fun project!
> 
> I’ll let Marko or the Linaro folks chime in on the K64F, however, I wanted to point to the excellent article the code coup guys wrote on running Mynewt with Eclipse:
> 
> https://www.codecoup.pl/blog/hacking-mynewt-in-eclipse/
> 
> Sterling
> 
> On 25 Jan 2017, at 12:36, Neilh wrote:
> 
>> Hi
>> 
>> I'm liking the myNewt direction and thanks for the explanations, wiki and
>> videos.
>> 
>> I've got a Nxp/Freescale Kinetis custom board with a MK26
>> (flash1M/ram200k 2*otg) KinetisK  that is similar to MK64F on FRDM-MK64F
>> 
>> I have a FRDM-MK64F board and also an olimex-H407 (same processor as olimex-E407 but no Ethernet).
>> 
>> I have the newt tools brought into an Ubuntu 16.04 and run the sim_blinkey
>> 
>> I was thinking of getting started with trying to bring up the FRDM-K64F,
>> thought that is marked as untested so far.   It does have the USB/SDA
>> loader.
>> myproj\repos\apache-mynewt-core\hw\bsp\frdm-k64f\src  seems to have the
>> basics.
>> 
>> Alternatively, I could familiarize myself work through the Olimex-E407
>> 
>> My  environment so far has been IDE Freescale Kinetis Design
>> Studio/Eclipse building nuttx OS, and with integration to Multilink JTAG
>> for blowing the flash.
>> 
>> There was a new feature request for an Eclipse plugin for myNewt, but it was marked as dup, and I haven't seen any other mention of Eclipse IDE so
>> far.
>> 
>> Any recommendation on getting started with FRDM-K64F?   or should I
>> start with Olimex
>> 
>> thanks
>> 
>> 
>> -- 
>> Neil Hancock


Re: newNewt

Posted by Sterling Hughes <st...@gmail.com>.
Hi Neil,

Sounds like a fun project!

I\u2019ll let Marko or the Linaro folks chime in on the K64F, however, I 
wanted to point to the excellent article the code coup guys wrote on 
running Mynewt with Eclipse:

https://www.codecoup.pl/blog/hacking-mynewt-in-eclipse/

Sterling

On 25 Jan 2017, at 12:36, Neilh wrote:

> Hi
>
>  I'm liking the myNewt direction and thanks for the explanations, wiki 
> and
> videos.
>
> I've got a Nxp/Freescale Kinetis custom board with a MK26
> (flash1M/ram200k 2*otg) KinetisK  that is similar to MK64F on 
> FRDM-MK64F
>
> I have a FRDM-MK64F board and also an olimex-H407 (same processor as 
> olimex-E407 but no Ethernet).
>
> I have the newt tools brought into an Ubuntu 16.04 and run the 
> sim_blinkey
>
> I was thinking of getting started with trying to bring up the 
> FRDM-K64F,
> thought that is marked as untested so far.   It does have the USB/SDA
> loader.
> myproj\repos\apache-mynewt-core\hw\bsp\frdm-k64f\src  seems to have 
> the
> basics.
>
> Alternatively, I could familiarize myself work through the Olimex-E407
>
> My  environment so far has been IDE Freescale Kinetis Design
> Studio/Eclipse building nuttx OS, and with integration to Multilink 
> JTAG
> for blowing the flash.
>
> There was a new feature request for an Eclipse plugin for myNewt, but 
> it was marked as dup, and I haven't seen any other mention of Eclipse 
> IDE so
> far.
>
> Any recommendation on getting started with FRDM-K64F?   or should I
> start with Olimex
>
> thanks
>
>
> -- 
> Neil Hancock