electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Segger JLink/Arm M4 issues, possible electronic stupidity.
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [9 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
BobTheDog



Joined: Feb 28, 2005
Posts: 4044
Location: England
Audio files: 32
G2 patch files: 15

PostPosted: Sat Apr 21, 2018 11:51 am    Post subject: Segger JLink/Arm M4 issues, possible electronic stupidity. Reply with quote  Mark this post and the followings unread

Hi Guys,

I have a Teensy 3.6 board here, which has a ARM M4F from NXP.

It has debug connections to the M4, but also a little ARM M0 chip which is used for protection and flashing the M4. The firmware of this M0 causes issues with the debug signals so I have "removed" the M0 by cutting its power trace.

When the M0 has been removed The reset line is always grounded so I have used a 4.7k pull-up resister between the reset and 3.3v. With this the board boots ok.

I have connected up a Segger JLink, if I use JLinkExe I can connect to the board, halt it, reset it and get it to run code. All works fine.

If I use JLinkGDBServer though I run into problems which I guessed were something to do with the cpu not halting correctly. or halting and then restarting, or reading. Not quite sure which one but you get errors for these.

It all starts with this warning

Code:

Connecting to target...WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.



So I connected up an oscilloscope to see what was going on, first thing to check was the reset line. With the scope attached, everything works fine. With the scope detached warning as above and then lots of issues.

Next test was to remove the scope ground, still works.

Next test was to disconnect the probe from the scope, still works.

Next test is to remove the probe from the reset pin, stops working.

Next test was to connect a wire to the reset pin and hold the other end in my fingers, everything works.

I am a bit stumped, my electronic skills are very limited consisting of an "A level" over 30 years ago where I spent most of the lectures in the pub so I am a bit stumped here.

Anyone got any ideas?
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sat Apr 21, 2018 12:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

Maybe try 10k or even 47k for the pullup .. I've seen debuggers to be very picky on the reset pullup.
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
BobTheDog



Joined: Feb 28, 2005
Posts: 4044
Location: England
Audio files: 32
G2 patch files: 15

PostPosted: Sat Apr 21, 2018 12:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Jan,

I was hoping you would answer, thanks.

I will give it a try tomorrow and get back with the results...

Cheers

Andy
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sat Apr 21, 2018 1:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Also .. the probe cable has some capacitance .. so maybe add a small capacitor .. as reset pulses need to have a certain length .. the data sheet should tell about it. But this seems a lil tricky as it would load the debugger's reset out .. maybe there is an application note for the debugger ... ah .. from the jlink manual :

Quote:
4.3.17 reset
Resets and halts the target CPU. Make sure the device is selected prior to using this com- mand to make use of the correct reset strategy.
Syntax
reset
Example
4.3.18 semihosting breakOnError
Enables or disables halting the target at the semihosting breakpoint / in SVC handler if an error occurred during a semihosting command, for example a bad file handle for SYS_WRITE.
Note
There are different reset strategies for different CPUs. Moreover, the reset strategies which are available differ from CPU core to CPU core. J-Link can perform various reset strategies and always selects the best fitting strategy for the selected device.


So will have to look at the actual processor specs for a preferred reset circuit ... hmm not easy to find . .what I do find is that it needs be longer than 100 ns, so that would not be an issue .. but also that it needs to go down to 80 mV .. when I'm reading things correctly .. which could be an issue .. so a higher valued resistor could be the thing ...

Was reading datasheets for NXP MK66FN2M0VMD18 MK66FX1M0VMD18 MK66FN2M0VLQ18 MK66FX1M0VLQ18 series.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
BobTheDog



Joined: Feb 28, 2005
Posts: 4044
Location: England
Audio files: 32
G2 patch files: 15

PostPosted: Sun Apr 22, 2018 2:36 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi Jan,

Thanks very much for looking into that for me, much appreciated.

Just about to fire up the soldering iron...
Back to top
View user's profile Send private message
BobTheDog



Joined: Feb 28, 2005
Posts: 4044
Location: England
Audio files: 32
G2 patch files: 15

PostPosted: Sun Apr 22, 2018 4:35 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi Jan,

I desoldered the 4.7K and connected it up to a bread board to try various resistors, no luck including the original 4.7k.

What I am noticing is that the reset line is sitting at around 1.16V with nothing connected to it.

If I connect it via a resistor to 3.3 V it always stays at 1.16V.

So I guessed this may be where the problem lies?

Looking at the teensy 3.6 schematic here: https://www.pjrc.com/teensy/schematic.html I also cut the traces to pins 4 and 13 of the MLK02 which were connected to reset on the m4.

Now on the reset line there was a 12.5khz pulse at 2V or so, I guessed this was something the M4 was doing?

So I connected it all back to the breadboard with a 20K pull-up and it works, without a probe as well Smile

I then tried with the 4.7K, 10K, and 47K and they also worked. What is the best value to go for for do you think?
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sun Apr 22, 2018 4:50 am    Post subject: Reply with quote  Mark this post and the followings unread

Great :-)

Apparently the value of the resistor matters not too much then .. whatever you put in last I'd leave it like that .. can always change it later.

And of course .. when that MKL thing is not powered the protection diodes in it would clamp the reset signal around ground .. I did not look well enough ...

What are you going to make?

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
BobTheDog



Joined: Feb 28, 2005
Posts: 4044
Location: England
Audio files: 32
G2 patch files: 15

PostPosted: Sun Apr 22, 2018 5:40 am    Post subject: Reply with quote  Mark this post and the followings unread

Well there is a few ideas which I have failed to do on other boards because of having to try to write USB Device code for Audio and Midi, something I have failed at!

The Teensy libs have a 2 in 2 out 44.1k, 16x16 midi ports and raw hid device code that just works and also host 16/16 midi for connecting up via the host usb once you have wired up a usb port to one of the headers. This also works.

So I have two projects planned:

1. A midi processor to go between a midi controller and a host, a more advanced version of this: http://www.midisolutions.com/prodepp.htm. A little editor to run on the host to set programs up that can then be selected from midi from the host.

2. A Eurorack thingy with 2 channel audio in/out and also cv using a MAX11300 https://www.maximintegrated.com/en/products/analog/data-converters/analog-to-digital-converters/MAX11300.html I have the code going for the MAX11300 from an earlier failed attempt using a Zynq FPGA board but running on the ARM rather than the FPGA so I need to get that over to the teensy. I want a modular type system where you can set programs up with selections of modules via the usb and then just load up those programs to get different setups. Basic things to start with like envelopes, LFOs and clock stuff.

None of it will ever work but it gives me something to do when I don't feel like working Wink
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Tue May 01, 2018 7:28 am    Post subject: Reply with quote  Mark this post and the followings unread

BobTheDog wrote:
I want a modular type system where you can set programs up with selections of modules via the usb and then just load up those programs to get different setups. Basic things to start with like envelopes, LFOs and clock stuff.

None of it will ever work but it gives me something to do when I don't feel like working Wink


It is a very nice idea, had been toying with it in my head too Wink

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [9 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use