查看: 4211|回复: 0
打印 上一主题 下一主题

发个jlink v9工具,含代码

[复制链接]
跳转到指定楼层
沙发
发表于 2015-6-14 17:05:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
工具,用到了Taoist大神的dumpfw.exe,特别感谢.

用法:将解压后的文件复制到   C:\Program Files\SEGGER\JLink_Vxxx   目录下
运行makev9fw.exe
之后J-Link V9 ALL.bin就会被更新了




帮大家熟悉一下vb.net代码:

Module Make
    Sub Main()
        Console.WriteLine("-------------------------------------------------------")
        Console.WriteLine("                 提取并合成JLink V9固件")
        Console.WriteLine("-------------------------------------------------------")
        If IO.File.Exists("dumpfw.exe") Then
            IO.File.Delete("J-Link V9.bin")
            Console.ForegroundColor = ConsoleColor.Blue
            Console.WriteLine("正在从JlinkArm.dll提取需要的固件文件...")
            Dim prc = Process.Start("dumpfw.exe")
            prc.WaitForExit()
            If IO.File.Exists("J-Link V9.bin") Then
                If IO.File.Exists("J-Link V9 ALL.bin") Then
                    Console.WriteLine("正在合并文件到J-Link V9 ALL.bin...")
                    Dim bufall = IO.File.ReadAllBytes("J-Link V9 ALL.bin")
                    Dim buffw = IO.File.ReadAllBytes("J-Link V9.bin")
                    Array.Copy(buffw, 0, bufall, 0, 1024)           '修改起始向量
                    Array.Copy(buffw, 0, bufall, 64 * 1024, buffw.Length)   '更新固件
                    IO.File.WriteAllBytes("J-Link V9 ALL.bin", bufall)

                    Console.WriteLine("J-Link V9 ALL.bin文件生成成功!")
                    Console.WriteLine("需要写入单片机的0x08000000地址! 任意键退出...")
                Else
                    Console.WriteLine("没有发现原来的J-Link V9 ALL.bin文件,任意键退出...")
                End If
            Else
                Console.WriteLine("没有从JlinkArm.dll提取到需要的固件文件,任意键退出...")
            End If
        Else
            Console.WriteLine("需要Taoist大虾的dumpfw.exe软件支持,任意键退出...")
        End If
        Console.ReadKey()
    End Sub
End Module
转载

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入因仑

本版积分规则

快速回复 返回顶部 返回列表